From ef9524ac7afecd9239b6765291635de3c6cd35fe Mon Sep 17 00:00:00 2001 From: Donal Hurley Date: Wed, 7 Aug 2024 16:35:49 +0100 Subject: [PATCH] Fix post install script for when no nginx instance is installed (#773) --- scripts/packages/postinstall.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/packages/postinstall.sh b/scripts/packages/postinstall.sh index 54d3790486..0572d47265 100755 --- a/scripts/packages/postinstall.sh +++ b/scripts/packages/postinstall.sh @@ -24,7 +24,7 @@ WORKER_USER="" AGENT_GROUP="nginx-agent" detect_nginx_users() { - if command -V systemctl >/dev/null 2>&1 && [ "$(cat /proc/1/comm)" = "systemd" ]; then + if command -V systemctl >/dev/null 2>&1 && systemctl status nginx >/dev/null 2>&1 && [ "$(cat /proc/1/comm)" = "systemd" ]; then printf "PostInstall: Reading NGINX systemctl unit file for user information\n" nginx_unit_file=$(systemctl status nginx | grep -Po "\(\K\/.*service") pid_file=$(grep -Po "PIDFile=\K.*$" "${nginx_unit_file}")