#!/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.
#
# 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"
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=$?
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() {