From 8236cb52d27d99e53d0de276994dab1ae3f87a52 Mon Sep 17 00:00:00 2001 From: Alex Vandiver Date: Thu, 25 Jun 2020 20:33:22 +0000 Subject: [PATCH] installer: Switch has_* variables for has_class checks. These are more correct to the sense of "is this a service we configured for Zulip", and removes potential confusion around the 0/1 values being backwards from how binary is usually interpreted. --- scripts/lib/install | 42 +++++++++++------------------------------- 1 file changed, 11 insertions(+), 31 deletions(-) diff --git a/scripts/lib/install b/scripts/lib/install index acbf210755..9738fe1298 100755 --- a/scripts/lib/install +++ b/scripts/lib/install @@ -408,28 +408,6 @@ fi "$ZULIP_PATH"/scripts/zulip-puppet-apply -f -if [ "$package_system" = apt ]; then - SUPERVISOR_CONF_DIR="/etc/supervisor/conf.d" -elif [ "$package_system" = yum ]; then - SUPERVISOR_CONF_DIR="/etc/supervisord.d/conf.d" -fi - -# Detect which features were selected for the below -set +e -[ -e "/etc/init.d/nginx" ]; has_nginx=$? -[ -e "$SUPERVISOR_CONF_DIR/zulip.conf" ]; has_appserver=$? -[ -e "/etc/cron.d/rabbitmq-numconsumers" ]; has_rabbit=$? -[ -e "/etc/init.d/postgresql" ]; has_postgres=$? -set -e - -# Docker service setup is done in the docker config, not here -if [ "$DEPLOYMENT_TYPE" = "dockervoyager" ]; then - has_nginx=1 - has_appserver=0 - has_rabbit=1 - has_postgres=1 -fi - # These server restarting bits should be moveable into puppet-land, ideally if [ "$package_system" = apt ]; then apt-get -y upgrade @@ -438,12 +416,13 @@ elif [ "$package_system" = yum ]; then : fi -if [ "$has_nginx" = 0 ]; then +if has_class "zulip::nginx" && [ ! "$DEPLOYMENT_TYPE" = "dockervoyager" ]; then # Check nginx was configured properly now that we've installed it. # Most common failure mode is certs not having been installed. - nginx -t || ( - set +x - cat </dev/null; then set +x cat <