diff --git a/scripts/lib/check-upstart b/scripts/lib/check-upstart new file mode 100755 index 0000000000..44d92930cd --- /dev/null +++ b/scripts/lib/check-upstart @@ -0,0 +1,11 @@ +#!/bin/bash +release=$(lsb_release -sc) + +if [ "$release" = "xenial" ] && [ -x /sbin/start ] && [ -x /sbin/stop ] && [ -x /sbin/restart ] && [ -x /sbin/status ] && [ -x /sbin/initctl ]; then + echo "You appear to be running Ubuntu Xenial, but with the upstart package installed." + echo "In Ubuntu Xenial, upstart has been replaced by systemd, and having upstart" + echo "installed will break the init scripts for Zulip dependencies like nginx." + echo "Please uninstall the \"upstart\" package (apt-get remove upstart) and rerun" + echo "this install script." + exit 1 +fi diff --git a/scripts/lib/install b/scripts/lib/install index 023d45e759..9b0565b8aa 100755 --- a/scripts/lib/install +++ b/scripts/lib/install @@ -27,6 +27,9 @@ ZULIP_PATH="$(realpath $(dirname $0)/../..)" apt-get -y dist-upgrade $APT_OPTIONS apt-get install -y puppet git python python3 python-six python3-six crudini $ADDITIONAL_PACKAGES +# Handle issues around upstart on Ubuntu Xenial +"$ZULIP_PATH"/scripts/lib/check-upstart + # Create and activate a virtualenv if [ "$VIRTUALENV_NEEDED" = "yes" ]; then "$ZULIP_PATH"/scripts/lib/create-production-venv "$ZULIP_PATH" diff --git a/scripts/lib/upgrade-zulip-stage-2 b/scripts/lib/upgrade-zulip-stage-2 index d3a2610d8c..19d723a50e 100755 --- a/scripts/lib/upgrade-zulip-stage-2 +++ b/scripts/lib/upgrade-zulip-stage-2 @@ -38,6 +38,9 @@ args = parser.parse_args() deploy_path = args.deploy_path os.chdir(deploy_path) +# Handle issues around upstart on Ubuntu Xenial +subprocess.check_call(["./scripts/lib/check-upstart"]) + if not args.skip_puppet: logging.info("Upgrading system packages...") subprocess.check_call(["apt-get", "update"])