From: Martin Schwenke Date: Tue, 10 May 2016 16:42:40 +0000 (+1000) Subject: ctdb-scripts: Support systemctl directly X-Git-Tag: tdb-1.3.10~1092 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=61d38c8556ddbdd99de8186f5246f597241f62de;p=thirdparty%2Fsamba.git ctdb-scripts: Support systemctl directly Some Linux distributions don't have a "service" compatibility command. To avoid breaking working systems, prefer the "service" compatibility command just in case it does some extra, unexpected magic. Signed-off-by: Martin Schwenke Reviewed-by: Kai Blin --- diff --git a/ctdb/config/functions b/ctdb/config/functions index 8a8ee8c89f6..c1316bd3c74 100755 --- a/ctdb/config/functions +++ b/ctdb/config/functions @@ -212,6 +212,8 @@ _service () $_nice /sbin/service "$_service_name" "$_op" elif [ -x /usr/sbin/service ]; then $_nice /usr/sbin/service "$_service_name" "$_op" + elif [ -x /bin/systemctl ]; then + $_nice /bin/systemctl "$_op" "$_service_name" elif [ -x $CTDB_SYS_ETCDIR/init.d/$_service_name ]; then $_nice $CTDB_SYS_ETCDIR/init.d/$_service_name "$_op" elif [ -x $CTDB_SYS_ETCDIR/rc.d/init.d/$_service_name ]; then