#!/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
[ -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() {
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
condrestart() {
if [ ! -f /var/lock/subsys/cgred ]; then
- msg_not_running "cgred"
+ msg_not_running "CGroup Rules Engine Daemon"
RETVAL=$1
return
fi
condrestart 7
;;
status)
- status -p /var/run/cgred.pid cgred
+ status --pidfile /var/run/cgrulesengd.pid cgrulesengd
RETVAL=$?
;;
*)