pre_install() {
	useradd -U -l -M -r -s /usr/bin/nologin -d /var/lib/{{name}} -c "{{description}}" {{name}}
}

post_install() {
	openssl genrsa -out /etc/{{name}}/{{name}}.rsa 1024
	openssl rsa -in /etc/{{name}}/{{name}}.rsa -pubout > /etc/{{name}}/{{name}}.rsa.pub
	chown {{name}}:{{name}} /etc/{{name}}/{{name}}.rsa*
	
	systemctl enable {{name}}
	systemctl enable {{name}}.socket
	systemctl -q try-reload-or-restart nginx
}

pre_upgrade() {
	systemctl stop {{name}}.socket
	systemctl stop {{name}}
}

post_upgrade() {
	systemctl start {{name}}.socket
	systemctl -q try-reload-or-restart nginx
}

pre_remove() {
	systemctl stop {{name}}.socket
	systemctl disable {{name}}.socket
	systemctl stop {{name}}
	systemctl disable {{name}}
}

post_remove() {
	systemctl -q try-reload-or-restart nginx
	userdel {{name}}
	groupdel {{name}}
}

pre_install() {
	useradd -U -l -M -r -s /usr/bin/nologin -d /var/lib/{{name}} -c "{{description}}" {{name}}
}

post_install() {
	openssl genrsa -out /etc/{{name}}/{{name}}.rsa 1024
	openssl rsa -in /etc/{{name}}/{{name}}.rsa -pubout > /etc/{{name}}/{{name}}.rsa.pub
	chown {{name}}:{{name}} /etc/{{name}}/{{name}}.rsa*
	
	systemctl daemon-reload
	systemctl enable {{name}}
	systemctl enable {{name}}.socket
	systemctl -q try-reload-or-restart nginx
}

pre_upgrade() {
	systemctl stop {{name}}.socket
	systemctl stop {{name}}
}

post_upgrade() {
	systemctl daemon-reload
	systemctl start {{name}}.socket
	systemctl -q try-reload-or-restart nginx
}

pre_remove() {
    systemctl stop {{name}}.socket
	systemctl disable {{name}}.socket
	systemctl stop {{name}}
	systemctl disable {{name}}
}

post_remove() {
	systemctl -q try-reload-or-restart nginx
	systemctl daemon-reload
	userdel {{name}}
	groupdel {{name}}
}

Revert "fix(pacman): systemct daemon-reload is done automatically"
Revert "fix(pacman): systemct daemon-reload is done automatically"

This reverts commit 25f320c4a4ea09aa6d45afdfa8af731c52a9e2f8.
