From bd85a89d4cf5b3c7df43686dbcd01411ed48ee07 Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Sat, 2 Apr 2016 15:06:55 +0200 Subject: [PATCH] more robust Apache restart --- lam-packaging/debian/postinst | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lam-packaging/debian/postinst b/lam-packaging/debian/postinst index b6183128..4ef19956 100755 --- a/lam-packaging/debian/postinst +++ b/lam-packaging/debian/postinst @@ -102,12 +102,14 @@ if [ "$1" = "configure" ]; then if [ "$RET" = "true" ]; then for server in $restart; do server=${server%,} - if [ `which invoke-rc.d` ]; then + if [ `which systemctl` ]; then + if [ "`systemctl is-active ${server}.service`" = "active" ]; then + systemctl reload ${server}.service + fi + elif [ `which invoke-rc.d` ]; then invoke-rc.d $server reload elif [ `which service` ]; then service $server reload - elif [ `which systemctl` ]; then - systemctl reload ${server}.service fi done fi