- updated to 1.2.0
[packages/cpufreqd.git] / cpufreqd.init
1 #!/bin/sh
2 #
3 # cpufreqd              Starts the cpufreqd daemon
4 #
5 # chkconfig:    345 44 56
6 # description:  adjust cpu speed
7 # processname:  cpufreqd
8 #
9 # pidfile:      /var/run/cpufreqd.pid
10
11 # Source function library.
12 . /etc/rc.d/init.d/functions
13
14 # Configuration file.
15 [ -f /etc/sysconfig/cpufreqd ] && . /etc/sysconfig/cpufreqd
16
17
18 RETVAL=0
19 # See how we were called.
20 case "$1" in
21   start)
22         # Start daemons.
23         if [ ! -f /var/lock/subsys/cpufreqd ]; then
24                 msg_starting cpufreqd
25                 daemon cpufreqd
26                 RETVAL=$?
27                 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/cpufreqd
28         else
29                 msg_already_running cpufreqd
30         fi
31         ;;
32   stop)
33         # Stop daemons.
34         if [ -f /var/lock/subsys/cpufreqd ]; then
35                 msg_stopping cpufreqd
36                 killproc cpufreqd
37                 rm -f /var/lock/subsys/cpufreqd >/dev/null 2>&1
38         else
39                 msg_not_running cpufreqd
40         fi
41         ;;
42   reload|force-reload)
43         if [ -f /var/lock/subsys/cpufreqd ]; then
44                 msg_reloading cpufreqd
45                 killproc cpufreqd -HUP
46                 RETVAL=$?
47         else
48                 msg_not_running cpufreqd >&2
49                 exit 7
50         fi
51         ;;
52   restart)
53         $0 stop
54         $0 start
55         exit $?
56         ;;
57   status)
58         status cpufreqd
59         exit $?
60         ;;
61   *)
62         msg_usage "$0 {start|stop|restart|reload|force-reload|status}"
63         exit 3
64 esac
65
66 exit $RETVAL
This page took 0.093658 seconds and 3 git commands to generate.