From 047fd17f317591ac5c87c5362b50afe240d3354f Mon Sep 17 00:00:00 2001 From: Ken'ichi Ohmichi Date: Mon, 6 Apr 2009 17:04:08 +0900 Subject: Add some success/error messages to 'cgconfig' service. 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 Signed-off-by: Dhaval Giani --- scripts/init.d/cgconfig | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/scripts/init.d/cgconfig b/scripts/init.d/cgconfig index 6e6bcd6..6b01d9c 100644 --- a/scripts/init.d/cgconfig +++ b/scripts/init.d/cgconfig @@ -69,6 +69,7 @@ umount_fs() { } start() { + echo -n "Starting cgconfig service: " if [ -f /var/lock/subsys/$servicename ] then log_warning_msg "lock file already exists" @@ -77,11 +78,11 @@ start() { 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 @@ -136,7 +137,14 @@ start() { 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() { @@ -169,9 +177,11 @@ 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() { -- cgit