From cac272a247ea16058347601dd12a3de10ba3e99d Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sat, 2 Jan 2016 02:29:57 -0500 Subject: [PATCH] Fix restarts of systemctl and dokku-installer We previously assumed that systemd was detectable by the existence of certain directories. Unfortunately, it seems 14.04 already has these directories, so we need to handle this case separately. One other note is that dokku-installer will fail to "start" if already started on certain systems, thus the previous grep was more accurate in it's running. --- debian/postinst | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/debian/postinst b/debian/postinst index d6fd2101d..2493a9b41 100755 --- a/debian/postinst +++ b/debian/postinst @@ -56,8 +56,13 @@ case "$1" in /usr/share/dokku/contrib/dokku-installer.py onboot echo "Starting dokku-installer" - [[ -f /etc/systemd/system ]] && systemctl daemon-reload - service dokku-installer start + if command -v systemctl &>/dev/null; then + systemctl daemon-reload + fi + + if service dokku-installer status 2> /dev/null | grep -E "waiting|inactive" ; then + service dokku-installer start + fi fi db_get "dokku/web_config"