aboutsummaryrefslogtreecommitdiffstats
path: root/rc.d/init.d/functions
diff options
context:
space:
mode:
authorLukas Nykryn <lnykryn@redhat.com>2015-08-26 14:59:01 +0200
committerLukas Nykryn <lnykryn@redhat.com>2015-08-26 15:03:14 +0200
commit6a4433a99fb086f48f66c6c07e61df9a0538085c (patch)
tree440777a8d2a62c512434544e33b26d9dc1382889 /rc.d/init.d/functions
parent969a6ee6382d4479482a4aa2066cadbc25593081 (diff)
downloadinitscripts-6a4433a99fb086f48f66c6c07e61df9a0538085c.tar
initscripts-6a4433a99fb086f48f66c6c07e61df9a0538085c.tar.gz
initscripts-6a4433a99fb086f48f66c6c07e61df9a0538085c.tar.bz2
initscripts-6a4433a99fb086f48f66c6c07e61df9a0538085c.tar.xz
initscripts-6a4433a99fb086f48f66c6c07e61df9a0538085c.zip
init.d/functions: reload systemd if it can't see an initscript
In good old times it was enough to drop initscript to /etc/rc.d/init.d and call service start. Now you need to reload systemd before. For compatibility purposes we should check if systemd knows about the initscript and if not call systemctl daemon-reload automatically.
Diffstat (limited to 'rc.d/init.d/functions')
-rw-r--r--rc.d/init.d/functions4
1 files changed, 4 insertions, 0 deletions
diff --git a/rc.d/init.d/functions b/rc.d/init.d/functions
index 0ba07b08..8e5800b6 100644
--- a/rc.d/init.d/functions
+++ b/rc.d/init.d/functions
@@ -47,6 +47,10 @@ systemctl_redirect () {
options="--ignore-dependencies"
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"
}