From dc772518e7ed65bdd3556619b9fa594d6ed2a7e2 Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Tue, 26 Apr 2016 15:20:06 -0700 Subject: [PATCH] Don't chown supervisor socket if it doesn't exist. --- scripts/lib/install | 5 ++++- scripts/setup/postgres-init-db | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/scripts/lib/install b/scripts/lib/install index 7c68de20fc..e3abb59ff6 100755 --- a/scripts/lib/install +++ b/scripts/lib/install @@ -66,7 +66,10 @@ ln -nsf /etc/zulip/settings.py "$deploy_path"/zproject/local_settings.py mkdir -p "$deploy_path"/prod-static/serve cp -rT "$deploy_path"/prod-static/serve /home/zulip/prod-static chown -R zulip:zulip /home/zulip /var/log/zulip /etc/zulip/settings.py -chown zulip:zulip /var/run/supervisor.sock +if [ -e "/var/run/supervisor.sock" ]; then + # If supervisor isn't running, no need to chown its socket + chown zulip:zulip /var/run/supervisor.sock +fi cd /home/zulip/deployments/current diff --git a/scripts/setup/postgres-init-db b/scripts/setup/postgres-init-db index 5e0d3ba8be..9cecea8be2 100755 --- a/scripts/setup/postgres-init-db +++ b/scripts/setup/postgres-init-db @@ -3,7 +3,9 @@ set -e set -x # Shut down all services to ensure a quiescent state. -supervisorctl stop all +if [ -e "/var/run/supervisor.sock" ]; then + supervisorctl stop all +fi # Drop any open connections to any old database. Hackishly call using # source because postgres user can't read /root/zulip/scripts/setup.