Skip to content

Commit

Permalink
Fix post install script for when no nginx instance is installed (#773)
Browse files Browse the repository at this point in the history
  • Loading branch information
dhurley authored Aug 7, 2024
1 parent 5b5bc1f commit ef9524a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/packages/postinstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
Expand Down

0 comments on commit ef9524a

Please sign in to comment.