2 # Startup script for cpuspeed
4 # chkconfig: 12345 06 99
5 # description: Run dynamic CPU speed daemon
7 # Source function library.
8 . /etc/rc.d/init.d/functions
10 [ -f /usr/sbin/cpuspeed ] || exit 0
13 if [ -f /etc/sysconfig/cpuspeed ]; then
14 . /etc/sysconfig/cpuspeed
18 if [ ! -f /var/lock/subsys/cpuspeed ]; then
19 # Attempt to load scaling_driver if not loaded but it is configured
20 if [ ! -f /sys/devices/system/cpu/cpu0/cpufreq/scaling_driver ]; then
21 [ -n "$DRIVER" ] && /sbin/modprobe "$DRIVER"
24 # If not loaded, abort cpuspeed without [FAILED] message
25 [ ! -f /sys/devices/system/cpu/cpu0/cpufreq/scaling_driver ] && return 0
29 daemon cpuspeed -d $OPTS
31 [ $RETVAL = 0 ] && touch /var/lock/subsys/cpuspeed
39 if test "x`pidof cpuspeed`" != x; then
41 killproc cpuspeed -INT
44 if test "x`pidof cpuspeed`" != x; then
48 [ $RETVAL = 0 ] && rm -f /var/lock/subsys/cpuspeed
67 if test "x`pidof cpuspeed`" != x; then
73 echo $"Usage: $0 {start|stop|restart|condrestart|status}"