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
Thanks
Ken'ichi Ohmichi
Signed-off-by: Ken'ichi Ohmichi <[email protected]>
---
--- a/scripts/init.d/cgred 2009-04-07 09:32:29.000000000 +0900
+++ b/scripts/init.d/cgred 2009-04-07 09:51:35.000000000 +0900
@@ -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
;;
*)
------------------------------------------------------------------------------
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com
_______________________________________________
Libcg-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libcg-devel