~ubuntu-branches/ubuntu/natty/libcgroup/natty

« back to all changes in this revision

Viewing changes to debian/patches/cgred-initscript.diff

  • Committer: Bazaar Package Importer
  • Author(s): Dustin Kirkland, Jon Bernard
  • Date: 2009-08-26 11:29:17 UTC
  • Revision ID: james.westby@ubuntu.com-20090826112917-t8b0v0wcgb3ozn56
Tags: 0.34-0ubuntu1
[ Jon Bernard ]
Initial release (LP: #268714)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
 
5
@@ -27,6 +27,8 @@
 
6
 # Required-Stop:       $local_fs $syslog
 
7
 # Should-Start:                
 
8
 # Should-Stop:         
 
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
 
14
@@ -39,12 +41,11 @@
 
15
 [ -x $CGRED_BIN ] || exit 1
 
16
 
 
17
 # Source function library & LSB routines
 
18
-. /etc/rc.d/init.d/functions
 
19
 . /lib/lsb/init-functions
 
20
 
 
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"
 
29
@@ -63,14 +64,14 @@
 
30
 start()
 
31
 {
 
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}`"
 
36
                return 1
 
37
        fi
 
38
-       daemon --check $servicename --pidfile $pidfile $CGRED_BIN $OPTIONS
 
39
+       start_daemon -p $pidfile $CGRED_BIN $OPTIONS
 
40
        RETVAL=$?
 
41
        echo
 
42
-       [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$servicename
 
43
+       [ $RETVAL -eq 0 ] && touch /var/lock/$servicename
 
44
        echo "`pidof $processname`" > $pidfile
 
45
 }
 
46
 
 
47
@@ -81,7 +82,7 @@
 
48
        RETVAL=$?
 
49
        echo
 
50
        if [ $RETVAL -eq 0 ] ; then
 
51
-               rm -f /var/lock/subsys/$servicename
 
52
+               rm -f /var/lock/$servicename
 
53
                rm -f $pidfile
 
54
        fi
 
55
        log_success_msg
 
56
@@ -96,21 +97,21 @@
 
57
                stop
 
58
                ;;
 
59
        status)
 
60
-               status -p $pidfile $processname
 
61
+               status_of_proc -p $pidfile $processname
 
62
                RETVAL=$?
 
63
                ;;
 
64
-       restart)
 
65
+       restart|force-reload)
 
66
                stop
 
67
                start
 
68
                ;;
 
69
        condrestart)
 
70
-               if [ -f /var/lock/subsys/$servicename ] ; then
 
71
+               if [ -f /var/lock/$servicename ] ; then
 
72
                        stop
 
73
                        start
 
74
                fi
 
75
                ;;
 
76
        reload|flash)
 
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}`
 
81
                        RETVAL=$?