From e7bca0dcfce97d58a7d95f6ddb897f64794a7860 Mon Sep 17 00:00:00 2001 From: Mathieu Parent Date: Mon, 8 Mar 2010 21:19:35 +0100 Subject: [PATCH] Correct nice_service() nice takes a binary as argument and not a function or builtin command (This used to be ctdb commit e21b40db64b314a24caa2bc611cb48b93decb5aa) --- ctdb/config/functions | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/ctdb/config/functions b/ctdb/config/functions index b70a35290f6..6556b218ece 100644 --- a/ctdb/config/functions +++ b/ctdb/config/functions @@ -61,10 +61,19 @@ service() { ###################################################### # simulate /sbin/service (niced) on platforms that don't have it nice_service() { - # do nothing, when no service was specified - [ -z "$1" ] && return + _service_name="$1" + _op="$2" - nice service "$@" + # do nothing, when no service was specified + [ -z "$_service_name" ] && return + + if [ -x /sbin/service ]; then + nice /sbin/service "$_service_name" "$_op" + elif [ -x /etc/init.d/$_service_name ]; then + nice /etc/init.d/$_service_name "$_op" + elif [ -x /etc/rc.d/init.d/$_service_name ]; then + nice /etc/rc.d/init.d/$_service_name "$_op" + fi } ######################################################