From b417508c98e274a100969fa1d5262f0b689848d7 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Wed, 7 Mar 2018 23:32:52 -0500 Subject: [PATCH 1/2] fix: handle stopped nginx during debian installation Closes #3019 --- debian/preinst | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/debian/preinst b/debian/preinst index a9f11c882..e56ffdbe4 100755 --- a/debian/preinst +++ b/debian/preinst @@ -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 start || "$NGINX_INIT" nginx reload + ;; + ubuntu) + NGINX_INIT="/etc/init.d/nginx" + "$NGINX_INIT" start || "$NGINX_INIT" reload + ;; + esac exit 0 fi From 212ef01f7a8f0d05a1aa08dd4dd59a86516fdc0a Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Wed, 7 Mar 2018 23:43:40 -0500 Subject: [PATCH 2/2] fix: revert reload and start commands --- debian/preinst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/preinst b/debian/preinst index e56ffdbe4..dc3e4f1d3 100755 --- a/debian/preinst +++ b/debian/preinst @@ -30,11 +30,11 @@ case "$1" in case "$DOKKU_DISTRO" in debian) NGINX_INIT="/usr/sbin/invoke-rc.d" - "$NGINX_INIT" nginx start || "$NGINX_INIT" nginx reload + "$NGINX_INIT" nginx reload || "$NGINX_INIT" nginx start ;; ubuntu) NGINX_INIT="/etc/init.d/nginx" - "$NGINX_INIT" start || "$NGINX_INIT" reload + "$NGINX_INIT" reload || "$NGINX_INIT" start ;; esac exit 0