From: Ken'ichi Ohmichi Date: Tue, 7 Apr 2009 00:50:32 +0000 (+0900) Subject: Add some success/error messages to 'cgred' service. X-Git-Tag: v0.34~65^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=52ee80ca0f26e4a7350504c56fb17decb562420b;p=thirdparty%2Flibcgroup.git Add some success/error messages to 'cgred' service. Hi, The existing 'cgred' service displays a success message ([ OK ]) when the service is starting, but it does not display any messages when it is stopping/reloading. So this patch adds some success/error messages to 'cgred' service like the following: # service cgred start Starting CGroup Rules Engine Daemon... [ OK ] # # service cgred stop Stopping CGroup Rules Engine Daemon... [ OK ] # # service cgred restart Stopping CGroup Rules Engine Daemon... [ OK ] Starting CGroup Rules Engine Daemon... [ OK ] # # service cgred reload Reloading rules configuration... [ OK ] # This patch's purpose is almost same as the one of 'cgconfig' service: http://sourceforge.net/mailarchive/forum.php?thread_name=49D9B778.3000900%40mxs.nes.nec.co.jp&forum_name=libcg-devel Signed-off-by: Ken'ichi Ohmichi Signed-off-by: Dhaval Giani --- diff --git a/scripts/init.d/cgred b/scripts/init.d/cgred index 73ca4807..fa824dfe 100644 --- a/scripts/init.d/cgred +++ b/scripts/init.d/cgred @@ -67,7 +67,7 @@ start() { echo $"Starting CGroup Rules Engine Daemon..." if [ -f "/var/lock/subsys/$servicename" ] ; then - echo "$servicename is already running with PID `cat ${pidfile}`" + log_failure_msg "$servicename is already running with PID `cat ${pidfile}`" return 1 fi daemon --check $servicename --pidfile $pidfile $processname $OPTIONS @@ -87,6 +87,7 @@ stop() rm -f /var/lock/subsys/$servicename rm -f $pidfile fi + log_success_msg } # See how we are called @@ -116,9 +117,13 @@ case "$1" in echo $"Reloading rules configuration..." kill -s 12 `cat ${pidfile}` RETVAL=$? - echo + if [ $RETVAL -eq 0 ] ; then + log_success_msg + else + log_failure_msg + fi else - echo $"$servicename is not running." + log_failure_msg "$servicename is not running." fi ;; *)