3 # cgconfig Control Groups Configuration Startup
4 # chkconfig: 2345 01 99
5 # description: This script runs the cgconfigparser utility to parse and setup \
6 # the control group filesystem. It uses /etc/cgconfig.conf \
7 # and parses the configuration specified in there.
9 # Source function library
10 . /etc/rc.d/init.d/functions
13 [ -f /etc/sysconfig/cgconfig ] && . /etc/sysconfig/cgconfig
16 if [ -n "`grep /sys/fs/cgroup /proc/mounts`" ]; then
20 # kernel provides cgroups?
21 if [ ! -e /proc/cgroups ]; then
25 run_cmd "Mounting /sys/fs/cgroup" mount -t tmpfs -o uid=0,gid=0,mode=0755 cgroup /sys/fs/cgroup
29 # If /sys/fs/cgroup is not mounted, we don't bother
30 if [ -z "`grep /sys/fs/cgroup /proc/mounts`" ]; then
34 # Don't try to get too smart, just optimistically try to umount all
35 # that we think we mounted
36 run_cmd "Unmounting /sys/fs/cgroup" umount /sys/fs/cgroup
41 # Check if the service is already running?
42 if [ -f /var/lock/subsys/cgconfig ]; then
43 msg_already_running "cgconfig"
46 if [ ! -s /etc/cgconfig.conf ]; then
47 nls "/etc/cgconfig.conf is not configured"
52 msg_starting "cgconfig"; busy
54 out=$(/sbin/cgconfigparser -l /etc/cgconfig.conf 2>&1)
56 if [ $RETVAL -ne 0 ]; then
58 [ "$out" ] && echo >&2 "$out"
63 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/cgconfig
68 if [ ! -f /var/lock/subsys/cgconfig ]; then
69 msg_not_running "cgconfig"
73 msg_stopping "cgconfig"
77 rm -f /var/lock/subsys/cgconfig
83 if [ ! -f /var/lock/subsys/cgconfig ]; then
84 msg_not_running "cgconfig"
112 if [ -f /var/lock/subsys/cgconfig ] ; then
121 msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}"