more robust reload
This commit is contained in:
parent
bd85a89d4c
commit
bd93daa397
|
@ -37,12 +37,14 @@ if [ -f /usr/share/debconf/confmodule ]; then
|
||||||
set -e
|
set -e
|
||||||
for server in $restart; do
|
for server in $restart; do
|
||||||
server=${server%,}
|
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
|
invoke-rc.d $server reload
|
||||||
elif [ `which service` ]; then
|
elif [ `which service` ]; then
|
||||||
service $server reload
|
service $server reload
|
||||||
elif [ `which systemctl` ]; then
|
|
||||||
systemctl reload ${server}.service
|
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue