ubuntu 18: systemd kill ends up killing the script itself
This is because KillMode=control-group by default
(cherry picked from commit c07c8b5bb8)
This commit is contained in:
@@ -35,9 +35,13 @@ elif [[ "${service}" == "docker" ]]; then
|
||||
elif [[ "${service}" == "collectd" ]]; then
|
||||
systemctl restart --no-block collectd
|
||||
elif [[ "${service}" == "box" ]]; then
|
||||
# ExecReload does not work on ubuntu 18
|
||||
# systemctl reload --no-block box
|
||||
systemctl kill --signal=SIGHUP box
|
||||
readonly ubuntu_version=$(lsb_release -rs)
|
||||
if [[ "${ubuntu_version}" == "18.04" ]]; then
|
||||
pid=$(systemctl show box -p MainPID | sed 's/MainPID=//g')
|
||||
kill -HUP $MAINPID
|
||||
else
|
||||
systemctl reload --no-block box
|
||||
fi
|
||||
else
|
||||
echo "Unknown service ${service}"
|
||||
exit 1
|
||||
|
||||
Reference in New Issue
Block a user