install: Add clear error message if upstart is installed on Xenial.

Fixes #2199.
This commit is contained in:
Igor Tokarev
2016-11-23 19:49:15 +05:00
committed by Tim Abbott
parent 24f0029111
commit e6ae53cbff
3 changed files with 17 additions and 0 deletions

11
scripts/lib/check-upstart Executable file
View File

@@ -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

View File

@@ -27,6 +27,9 @@ ZULIP_PATH="$(realpath $(dirname $0)/../..)"
apt-get -y dist-upgrade $APT_OPTIONS apt-get -y dist-upgrade $APT_OPTIONS
apt-get install -y puppet git python python3 python-six python3-six crudini $ADDITIONAL_PACKAGES 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 # Create and activate a virtualenv
if [ "$VIRTUALENV_NEEDED" = "yes" ]; then if [ "$VIRTUALENV_NEEDED" = "yes" ]; then
"$ZULIP_PATH"/scripts/lib/create-production-venv "$ZULIP_PATH" "$ZULIP_PATH"/scripts/lib/create-production-venv "$ZULIP_PATH"

View File

@@ -38,6 +38,9 @@ args = parser.parse_args()
deploy_path = args.deploy_path deploy_path = args.deploy_path
os.chdir(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: if not args.skip_puppet:
logging.info("Upgrading system packages...") logging.info("Upgrading system packages...")
subprocess.check_call(["apt-get", "update"]) subprocess.check_call(["apt-get", "update"])