1
Index: libcgroup/scripts/init.d/cgred.in
2
===================================================================
3
--- libcgroup.orig/scripts/init.d/cgred.in 2009-08-24 23:55:43.890240020 -0400
4
+++ libcgroup/scripts/init.d/cgred.in 2009-08-24 23:59:11.350871678 -0400
6
# Required-Stop: $local_fs $syslog
9
+# Default-Start: 2 3 4 5
10
+# Default-Stop: 0 1 6
11
# Short-Description: start and stop the cgroups rules engine daemon
12
# Description: CGroup Rules Engine is a tool for automatically using \
13
# cgroups to classify processes
15
[ -x $CGRED_BIN ] || exit 1
17
# Source function library & LSB routines
18
-. /etc/rc.d/init.d/functions
19
. /lib/lsb/init-functions
21
# Read in configuration options.
22
-if [ -f "/etc/sysconfig/cgred.conf" ] ; then
23
- . /etc/sysconfig/cgred.conf
24
+if [ -f "/etc/default/cgred.conf" ] ; then
25
+ . /etc/default/cgred.conf
26
OPTIONS="$NODAEMON $LOG"
27
if [ -n "$LOG_FILE" ]; then
28
OPTIONS="$OPTIONS --log-file=$LOG_FILE"
32
echo $"Starting CGroup Rules Engine Daemon..."
33
- if [ -f "/var/lock/subsys/$servicename" ] ; then
34
+ if [ -f "/var/lock/$servicename" ] ; then
35
log_failure_msg "$servicename is already running with PID `cat ${pidfile}`"
38
- daemon --check $servicename --pidfile $pidfile $CGRED_BIN $OPTIONS
39
+ start_daemon -p $pidfile $CGRED_BIN $OPTIONS
42
- [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$servicename
43
+ [ $RETVAL -eq 0 ] && touch /var/lock/$servicename
44
echo "`pidof $processname`" > $pidfile
50
if [ $RETVAL -eq 0 ] ; then
51
- rm -f /var/lock/subsys/$servicename
52
+ rm -f /var/lock/$servicename
60
- status -p $pidfile $processname
61
+ status_of_proc -p $pidfile $processname
65
+ restart|force-reload)
70
- if [ -f /var/lock/subsys/$servicename ] ; then
71
+ if [ -f /var/lock/$servicename ] ; then
77
- if [ -f /var/lock/subsys/$servicename ] ; then
78
+ if [ -f /var/lock/$servicename ] ; then
79
echo $"Reloading rules configuration..."
80
kill -s 12 `cat ${pidfile}`