]> git.pld-linux.org Git - projects/rc-scripts.git/commitdiff
systemd takes preference if it is booted/active.
authorArkadiusz Miśkiewicz <arekm@maven.pl>
Sun, 4 Mar 2012 20:36:36 +0000 (20:36 +0000)
committerArkadiusz Miśkiewicz <arekm@maven.pl>
Sun, 4 Mar 2012 20:36:36 +0000 (20:36 +0000)
svn-id: @12484

service

diff --git a/service b/service
index 22a6e9943dc9e493aeb450b435b8936a65f6249f..c3cbaca4a16d6617a20373cce2fe27b512f50c9c 100755 (executable)
--- a/service
+++ b/service
@@ -124,11 +124,11 @@ while [ $# -gt 0 ]; do
        esac
 done
 
-if [ -x "${SERVICEDIR}/${SERVICE}" ]; then
-       exec env -i USE_UPSTART=$USE_UPSTART LANG=$LANG PATH=$PATH TERM=$TERM "${SERVICEDIR}/${SERVICE}" ${ACTION} ${OPTIONS}
-elif [ -x /bin/systemd_booted ] && systemd_booted; then
+if [ -x /bin/systemd_booted ] && /bin/systemd_booted && /bin/systemctl status ${SERVICE}.service > /dev/null 2>&1; then
        echo >&2 "Redirecting to /bin/systemctl ${OPTIONS} ${SERVICE}.service"
-       exec /bin/systemctl ${OPTIONS} ${SERVICE}.service
+       exec /bin/systemctl ${ACTION} ${SERVICE}.service ${OPTIONS}
+elif [ -x "${SERVICEDIR}/${SERVICE}" ]; then
+       exec env -i USE_UPSTART=$USE_UPSTART LANG=$LANG PATH=$PATH TERM=$TERM "${SERVICEDIR}/${SERVICE}" ${ACTION} ${OPTIONS}
 else
        echo "${SERVICE}: unrecognized service" >&2
        exit 1
This page took 0.514238 seconds and 4 git commands to generate.