File initd_cgconfig.patch of Package libcgroup
---
scripts/init.d/cgconfig.in | 32 ++++++++++++++++++++------------
1 file changed, 20 insertions(+), 12 deletions(-)
Index: libcgroup-0.41.rc1/scripts/init.d/cgconfig.in
===================================================================
--- libcgroup-0.41.rc1.orig/scripts/init.d/cgconfig.in
+++ libcgroup-0.41.rc1/scripts/init.d/cgconfig.in
@@ -4,6 +4,8 @@
#
# Copyright IBM Corporation. 2008
#
+# Copyright (c) 2008,2010 Jiri Slaby <jslaby@suse.cz>
+#
# Authors: Balbir Singh <balbir@linux.vnet.ibm.com>
# This program is free software; you can redistribute it and/or modify it
# under the terms of version 2.1 of the GNU Lesser General Public License
@@ -21,10 +23,12 @@
### BEGIN INIT INFO
# Provides: cgconfig
-# Required-Start:
-# Required-Stop:
+# Required-Start: $local_fs $remote_fs $syslog $time
+# Required-Stop: $local_fs $remote_fs $syslog $time
# Should-Start: ypbind
# Should-Stop: ypbind
+# Default-Start: 2 3 5
+# Default-Stop: 0 1 6
# Short-Description: Create and setup control group filesystem(s)
# Description: Create and setup control group filesystem(s)
### END INIT INFO
@@ -34,7 +38,7 @@ prefix=@prefix@;exec_prefix=@exec_prefix
CGCONFIGPARSER_BIN=$sbindir/cgconfigparser
CONFIG_FILE=/etc/cgconfig.conf
servicename=cgconfig
-lockfile=/var/lock/subsys/$servicename
+lockfile=/run/$servicename
#
# Source LSB routines
@@ -96,10 +100,9 @@ create_default_groups() {
}
start() {
- echo -n "Starting cgconfig service: "
if [ -f "$lockfile" ]; then
log_warning_msg "lock file already exists"
- return 0
+ return 1
fi
if [ $? -eq 0 ]; then
@@ -126,15 +129,12 @@ start() {
log_failure_msg "Failed to touch $lockfile"
return 1
fi
- log_success_msg
return 0
}
stop() {
- echo -n "Stopping cgconfig service: "
cgclear
rm -f "$lockfile"
- log_success_msg
return 0
}
@@ -170,33 +170,41 @@ RETVAL=0
case $1 in
'stop')
+ echo -n "Stopping service $servicename"
common
stop
RETVAL=$?
+ rc_failed 0
+ rc_status -v
;;
'start')
+ echo -n "Starting service $servicename"
common
start
RETVAL=$?
+ rc_status -v
;;
'restart'|'reload')
restart
RETVAL=$?
+ rc_status
;;
'condrestart')
if [ -f "$lockfile" ]; then
restart
RETVAL=$?
fi
+ rc_status
;;
'status')
+ echo -n "Checking for service $servicename"
if [ -f "$lockfile" ]; then
- echo "Running"
- exit 0
+ rc_failed 0
else
- echo "Stopped"
- exit 3
+ rc_failed 3
+ RETVAL=3
fi
+ rc_status -v
;;
*)
usage