From 868d92043d62e6cbd484d368ff938d3f0b007064 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 --- config/functions | 13 +++++++++++-- 1 files changed, 11 insertions(+), 2 deletions(-) diff --git a/config/functions b/config/functions index b70a352..6556b21 100644 --- a/config/functions +++ b/config/functions @@ -61,10 +61,19 @@ service() { ###################################################### # simulate /sbin/service (niced) on platforms that don't have it nice_service() { + _service_name="$1" + _op="$2" + # do nothing, when no service was specified - [ -z "$1" ] && return + [ -z "$_service_name" ] && return - nice service "$@" + 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 } ###################################################### -- 1.7.0