#!/bin/sh
#
# autocgroup:   Automatic process scheduling
#
# chkconfig: 345 57 99
# description:  This script set up the automaitc process scheduling \
#               using cgroup to improves the interactivity of desktop \
#               applications.

# Source function library.
. /etc/rc.d/init.d/functions

RETVAL=0

start() {
    echo -n $"Setting up automatic process scheduling: "
    mkdir -p /dev/cgroup/cpu
    mount -t cgroup cgroup /dev/cgroup/cpu -o cpu
    mkdir -m 0777 /dev/cgroup/cpu/user
    echo "/usr/sbin/cgroup_clean" > /dev/cgroup/cpu/release_agent
}

# See how we were called.
case "$1" in
    start)
        start
        ;;
    *)
        echo $"Usage: $0 start"
        RETVAL=1
        ;;
esac

exit $RETVAL
