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 <oomichi@mxs.nes.nec.co.jp>
Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
{
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
rm -f /var/lock/subsys/$servicename
rm -f $pidfile
fi
+ log_success_msg
}
# See how we are called
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
;;
*)