]> git.pld-linux.org Git - packages/libcgroup.git/blobdiff - cgred.init
- fixed setup
[packages/libcgroup.git] / cgred.init
index c0c37dc1986b35b192b9a004ac9f028a2c6a8506..4d117a7a69c388c738fbf727a41fb00673fcf261 100644 (file)
@@ -1,7 +1,7 @@
 #!/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.
 #
@@ -12,6 +12,9 @@
 # Source function library
 . /etc/rc.d/init.d/functions
 
+# Read in configuration options.
+[ -f /etc/sysconfig/cgred ] && . /etc/sysconfig/cgred
+
 start() {
        if [ -f /var/lock/subsys/cgred ]; then
                msg_already_running "CGroup Rules Engine Daemon"
@@ -30,23 +33,13 @@ start() {
        fi
 
        msg_starting "CGroup Rules Engine Daemon"
-       # Read in configuration options.
-       OPTIONS=""
-       if [ -f /etc/sysconfig/cgred.conf ]; then
-               . /etc/sysconfig/cgred.conf
-
-               OPTIONS="$NODAEMON $LOG"
-               [ -n "$LOG_FILE" ] && OPTIONS="$OPTIONS --logfile=$LOG_FILE"
-               [ -n "$SOCKET_USER" ] && OPTIONS="$OPTIONS -u $SOCKET_USER"
-               [ -n "$SOCKET_GROUP" ] && OPTIONS="$OPTIONS -g $SOCKET_GROUP"
-       fi
 
        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
+       touch /var/lock/subsys/cgred
        pidof cgrulesengd > /var/run/cgrulesengd.pid
 }
 
@@ -59,9 +52,7 @@ stop() {
        msg_stopping "CGroup Rules Engine Daemon"
        killproc --pidfile /var/run/cgrulesengd.pid cgrulesengd -TERM
        RETVAL=$?
-       if [ $RETVAL -eq 0 ] ; then
-               rm -f /var/lock/subsys/cgred /var/run/cgrulesengd.pid
-       fi
+       rm -f /var/lock/subsys/cgred /var/run/cgrulesengd.pid
 }
 
 reload() {
@@ -115,7 +106,7 @@ case "$1" in
        condrestart 7
        ;;
   status)
-       status --pid /var/run/cgrulesengd.pid cgrulesengd
+       status --pidfile /var/run/cgrulesengd.pid cgrulesengd
        RETVAL=$?
        ;;
   *)
This page took 0.218871 seconds and 4 git commands to generate.