diff options
author | Bill Nottingham <notting@redhat.com> | 2010-08-20 17:14:25 -0400 |
---|---|---|
committer | Bill Nottingham <notting@redhat.com> | 2010-08-20 17:14:25 -0400 |
commit | 64343a8c1191cfb4bcb209aef001942ffc7d60d9 (patch) | |
tree | 44bb5fc3360a261558e1ea96e1e5f193e3b426aa | |
parent | 6b548207e870f4e0d51937b0ae6e82f0e3d92dc5 (diff) | |
download | initscripts-64343a8c1191cfb4bcb209aef001942ffc7d60d9.tar initscripts-64343a8c1191cfb4bcb209aef001942ffc7d60d9.tar.gz initscripts-64343a8c1191cfb4bcb209aef001942ffc7d60d9.tar.bz2 initscripts-64343a8c1191cfb4bcb209aef001942ffc7d60d9.tar.xz initscripts-64343a8c1191cfb4bcb209aef001942ffc7d60d9.zip |
If a systemd service exists, use systemctl to frob it.
-rwxr-xr-x | service | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -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 |