From 64343a8c1191cfb4bcb209aef001942ffc7d60d9 Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Fri, 20 Aug 2010 17:14:25 -0400 Subject: If a systemd service exists, use systemctl to frob it. --- service | 3 +++ 1 file changed, 3 insertions(+) (limited to 'service') diff --git a/service b/service index 7d7dea8e..0fe03fda 100755 --- a/service +++ b/service @@ -7,6 +7,7 @@ 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 @@ -60,6 +61,8 @@ done if [ -f "${SERVICEDIR}/${SERVICE}" ]; then env -i PATH="$PATH" TERM="$TERM" "${SERVICEDIR}/${SERVICE}" ${OPTIONS} +elif [ -f "${SYSTEMDSERVICEDIR}/${SERVICE}.service" ]; then + exec /bin/systemctl ${OPTIONS} ${SERVICE}.service else echo $"${SERVICE}: unrecognized service" >&2 exit 1 -- cgit v1.2.1