Merge pull request #3101 from dokku/josegonzalez-patch-1

Handle stopped nginx during debian installation
This commit is contained in:
Jose Diaz-Gonzalez
2018-03-08 00:48:07 -05:00
committed by GitHub

12
debian/preinst vendored
View File

@@ -26,7 +26,17 @@ case "$1" in
} >> $NGINX_CONF
rm -f /etc/nginx/sites-enabled/*
service nginx reload || /etc/init.d/nginx reload
DOKKU_DISTRO="$(. /etc/os-release > /dev/null 2>&1 || true ; echo "$ID")"
case "$DOKKU_DISTRO" in
debian)
NGINX_INIT="/usr/sbin/invoke-rc.d"
"$NGINX_INIT" nginx reload || "$NGINX_INIT" nginx start
;;
ubuntu)
NGINX_INIT="/etc/init.d/nginx"
"$NGINX_INIT" reload || "$NGINX_INIT" start
;;
esac
exit 0
fi