diff options
author | Colin Guthrie <colin@mageia.org> | 2016-06-07 17:28:01 +0100 |
---|---|---|
committer | Colin Guthrie <colin@mageia.org> | 2016-06-07 17:28:01 +0100 |
commit | b53d95939e513b135b688548e8b587129ac683dd (patch) | |
tree | 7b5aea6656107fafe96382217323d18df5090454 /rc.d/init.d/functions | |
parent | 08eee6c0c91bcff0c401a12fd7b640a1831408ba (diff) | |
parent | 3a01f26785ca58a4c50648dbaccaf5ddbd61e028 (diff) | |
download | initscripts-b53d95939e513b135b688548e8b587129ac683dd.tar initscripts-b53d95939e513b135b688548e8b587129ac683dd.tar.gz initscripts-b53d95939e513b135b688548e8b587129ac683dd.tar.bz2 initscripts-b53d95939e513b135b688548e8b587129ac683dd.tar.xz initscripts-b53d95939e513b135b688548e8b587129ac683dd.zip |
Merge tag 'initscripts-9.66-1' into distro/mga
Tag as initscripts-9.66-1
Conflicts:
service
sysconfig/network-scripts/ifup-wireless
Notes:
The 'service' wrapper was kept as the Mageia version.
We should look into moving this over to the upstream version
although some people will likely complain at syntax changes.
ifup-wireless was also kept as Mageia version. The changes
introduced downstream in the past are complex and we cannot
easily merge in the upstream changes. We should try to move
away from this. Most users should use network manager but for
those using these legacy scripts we should at least try and use
e.g. iw rather than the legacy iwconfig utilities.
Diffstat (limited to 'rc.d/init.d/functions')
-rw-r--r-- | rc.d/init.d/functions | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/rc.d/init.d/functions b/rc.d/init.d/functions index fdf58bd0..ddb89cd5 100644 --- a/rc.d/init.d/functions +++ b/rc.d/init.d/functions @@ -57,6 +57,10 @@ systemctl_redirect () { options="$options --no-block" fi + if systemctl show -p LoadState "$prog.service" | grep -q 'not-found' ; then + action $"Reloading systemd: " /bin/systemctl daemon-reload + fi + action "$s" /bin/systemctl $options $command "$prog.service" } @@ -480,7 +484,14 @@ status() { if [ "$_use_systemctl" = "1" ]; then systemctl status ${0##*/}.service - return $? + ret=$? + # LSB daemons that dies abnormally in systemd looks alive in systemd's eyes due to RemainAfterExit=yes + # lets adjust the reality a little bit + if systemctl show -p ActiveState ${0##*/}.service | grep -q '=active$' && \ + systemctl show -p SubState ${0##*/}.service | grep -q '=exited$' ; then + ret=3 + fi + return $ret fi # First try "pidof" @@ -702,4 +713,5 @@ if [ "$_use_systemctl" = "1" ]; then fi strstr "$(cat /proc/cmdline)" "rc.debug" && set -x +return 0 |