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.