Hi,
The existing 'cgconfig' service does not display any message even if it
succeeds. So this patch adds some success/error messages to 'cgconfig'
service like the following:
# service cgconfig start
Starting cgconfig service: [ OK ]
#
# service cgconfig stop
Stopping cgconfig service: [ OK ]
#
# service cgconfig restart
Stopping cgconfig service: [ OK ]
Starting cgconfig service: [ OK ]
#
It makes test of 'cgconfig' service a little easy.
Signed-off-by: Ken'ichi Ohmichi <oomichi@mxs.nes.nec.co.jp>
Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
}
start() {
+ echo -n "Starting cgconfig service: "
if [ -f /var/lock/subsys/$servicename ]
then
log_warning_msg "lock file already exists"
if [ $? -eq 0 ]
then
- #log_progress_msg "Starting cgconfig service: "
cgconfigparser -l $CONFIG_FILE
retval=$?
if [ $retval -ne 0 ]
then
+ log_failure_msg "Failed to parse " $CONFIG_FILE
return $retval
fi
fi
done
touch /var/lock/subsys/$servicename
- return $?
+ retval=$?
+ if [ $retval -ne 0 ]
+ then
+ log_failure_msg "Failed to touch " /var/lock/subsys/$servicename
+ return $retval
+ fi
+ log_success_msg
+ return 0
}
move_all_to_init_class() {
stop() {
+ echo -n "Stopping cgconfig service: "
move_all_to_init_class
umount_fs
rm -f /var/lock/subsys/$servicename
+ log_success_msg
}
trapped() {