aboutsummaryrefslogtreecommitdiffstats
path: root/rc.d
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:04:02 +0200
commitccaff12b467734624ef41e623aa0f94fa05114af (patch)
tree1d01d6e5f50ce1d695836e672cc0e0f06e389175 /rc.d
parent640d0e25111477312e1dfb4cd1dfcf84c9cc8b9e (diff)
downloadinitscripts-ccaff12b467734624ef41e623aa0f94fa05114af.tar
initscripts-ccaff12b467734624ef41e623aa0f94fa05114af.tar.gz
initscripts-ccaff12b467734624ef41e623aa0f94fa05114af.tar.bz2
initscripts-ccaff12b467734624ef41e623aa0f94fa05114af.tar.xz
initscripts-ccaff12b467734624ef41e623aa0f94fa05114af.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')
-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 8c36e6b4..f7d3ca93 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"
}