From a2d6abdb3436731800d617d458675ca38eed44cc Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Fri, 16 Jan 2009 13:31:02 +0100 Subject: [PATCH] funcions: make (nice_)service a noop for empty service name Michael (This used to be ctdb commit 4cac2a16b70be772e4f1520020762f63c0bf3efe) --- ctdb/config/functions | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ctdb/config/functions b/ctdb/config/functions index cca93e9b9b6..48bcf252917 100644 --- a/ctdb/config/functions +++ b/ctdb/config/functions @@ -33,6 +33,10 @@ detect_init_style() { service() { service_name="$1" op="$2" + + # do nothing, when no service was specified + test "x$service_name" = "x" && return + if [ -x /sbin/service ]; then /sbin/service "$service_name" "$op" elif [ -x /etc/init.d/$service_name ]; then @@ -47,6 +51,10 @@ service() { nice_service() { service_name="$1" op="$2" + + # do nothing, when no service was specified + test "x$service_name" = "x" && return + if [ -x /sbin/service ]; then nice /sbin/service "$service_name" "$op" elif [ -x /etc/init.d/$service_name ]; then