]> git.pld-linux.org Git - packages/libcgroup.git/blobdiff - cgred.init
- load cn module for netlink connector
[packages/libcgroup.git] / cgred.init
index 9ff5329c0ce74bb6a14d1a4bbda3c85fc1f199b5..04f75cdc6b1a3a4a1ebb2be6a6b6f775075977a2 100644 (file)
@@ -1,12 +1,12 @@
 #!/bin/sh
 #
 # cgred                CGroups Rules Engine Daemon
-# chkconfig:   2345 14 86
+# chkconfig:   2345 02 98
 # description: This is a daemon for automatically classifying processes \
 #              into cgroups based on UID/GID.
 #
 # processname: cgrulesengd
-# pidfile:     /var/run/cgred.pid
+# pidfile:     /var/run/cgrulesengd.pid
 #
 
 # Source function library
@@ -41,13 +41,16 @@ start() {
                [ -n "$SOCKET_GROUP" ] && OPTIONS="$OPTIONS -g $SOCKET_GROUP"
        fi
 
-       daemon --pidfile /var/run/cgred.pid /sbin/cgrulesengd $OPTIONS
+       # netlink connector
+       modprobe -q cn > /dev/null 2>&1
+
+       daemon --pidfile /var/run/cgrulesengd.pid /sbin/cgrulesengd $OPTIONS
        RETVAL=$?
        if [ $RETVAL -ne 0 ]; then
                return 7
        fi
-       [ $RETVAL -eq 0 ] && touch /var/lock/subsys/cgred
-       pidof cgrulesengd > /var/run/cgred.pid
+       touch /var/lock/subsys/cgred
+       pidof cgrulesengd > /var/run/cgrulesengd.pid
 }
 
 stop() {
@@ -57,16 +60,14 @@ stop() {
        fi
 
        msg_stopping "CGroup Rules Engine Daemon"
-       killproc -p /var/run/cgred.pid cgrulesengd -TERM
+       killproc --pidfile /var/run/cgrulesengd.pid cgrulesengd -TERM
        RETVAL=$?
-       if [ $RETVAL -eq 0 ] ; then
-               rm -f /var/lock/subsys/cgred /var/run/cgred.pid
-       fi
+       rm -f /var/lock/subsys/cgred /var/run/cgrulesengd.pid
 }
 
 reload() {
        if [ ! -f /var/lock/subsys/cgred ] ; then
-               msg_not_running "cgred"
+               msg_not_running "CGroup Rules Engine Daemon"
                return
        fi
 
@@ -83,7 +84,7 @@ reload() {
 
 condrestart() {
        if [ ! -f /var/lock/subsys/cgred ]; then
-               msg_not_running "cgred"
+               msg_not_running "CGroup Rules Engine Daemon"
                RETVAL=$1
                return
        fi
@@ -115,7 +116,7 @@ case "$1" in
        condrestart 7
        ;;
   status)
-       status -p /var/run/cgred.pid cgred
+       status --pidfile /var/run/cgrulesengd.pid cgrulesengd
        RETVAL=$?
        ;;
   *)
This page took 0.076484 seconds and 4 git commands to generate.