Skip to content

Commit ef9524a

Browse files
authored
Fix post install script for when no nginx instance is installed (#773)
1 parent 5b5bc1f commit ef9524a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

scripts/packages/postinstall.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ WORKER_USER=""
2424
AGENT_GROUP="nginx-agent"
2525

2626
detect_nginx_users() {
27-
if command -V systemctl >/dev/null 2>&1 && [ "$(cat /proc/1/comm)" = "systemd" ]; then
27+
if command -V systemctl >/dev/null 2>&1 && systemctl status nginx >/dev/null 2>&1 && [ "$(cat /proc/1/comm)" = "systemd" ]; then
2828
printf "PostInstall: Reading NGINX systemctl unit file for user information\n"
2929
nginx_unit_file=$(systemctl status nginx | grep -Po "\(\K\/.*service")
3030
pid_file=$(grep -Po "PIDFile=\K.*$" "${nginx_unit_file}")

0 commit comments

Comments
 (0)