aboutsummaryrefslogtreecommitdiffstats
path: root/service
diff options
context:
space:
mode:
authorMichal Schmidt <mschmidt@redhat.com>2011-09-24 13:04:09 +0200
committerBill Nottingham <notting@redhat.com>2011-09-26 10:57:36 -0400
commite1afcc44754dab8adc7dd1099fbea61b941e52d9 (patch)
tree6398eb676004baf89527c919e297fb6eb06c78c6 /service
parent09bfb5033230e6846414bc6002aa12ce09c23687 (diff)
downloadinitscripts-e1afcc44754dab8adc7dd1099fbea61b941e52d9.tar
initscripts-e1afcc44754dab8adc7dd1099fbea61b941e52d9.tar.gz
initscripts-e1afcc44754dab8adc7dd1099fbea61b941e52d9.tar.bz2
initscripts-e1afcc44754dab8adc7dd1099fbea61b941e52d9.tar.xz
initscripts-e1afcc44754dab8adc7dd1099fbea61b941e52d9.zip
do not check for the existence of a systemd unit before redirecting
It is wrong to look only in /lib/systemd/system. systemd can handle units in several other directories as well. The check is needless. Simply redirect everything that's not a SysV service and let systemctl report an error if it's invalid.
Diffstat (limited to 'service')
-rwxr-xr-xservice6
1 files changed, 1 insertions, 5 deletions
diff --git a/service b/service
index 1a426356..6f179347 100755
--- a/service
+++ b/service
@@ -7,7 +7,6 @@ USAGE="Usage: $(basename $0) < option > | --status-all | \
[ service_name [ command | --full-restart ] ]"
SERVICE=
SERVICEDIR="/etc/init.d"
-SYSTEMDSERVICEDIR="/lib/systemd/system"
OPTIONS=
if [ $# -eq 0 ]; then
@@ -69,10 +68,7 @@ done
if [ -f "${SERVICEDIR}/${SERVICE}" ]; then
env -i PATH="$PATH" TERM="$TERM" SYSTEMCTL_IGNORE_DEPENDENCIES=${SYSTEMCTL_IGNORE_DEPENDENCIES} SYSTEMCTL_SKIP_REDIRECT=${SYSTEMCTL_SKIP_REDIRECT} "${SERVICEDIR}/${SERVICE}" ${OPTIONS}
-elif [ -f "${SYSTEMDSERVICEDIR}/${SERVICE}.service" ]; then
+else
echo $"Redirecting to /bin/systemctl ${OPTIONS} ${SERVICE}.service" >/dev/stderr
exec /bin/systemctl ${OPTIONS} ${SERVICE}.service
-else
- echo $"${SERVICE}: unrecognized service" >&2
- exit 1
fi