4
# Required-Start: $local_fs $syslog $remote_fs
5
# Required-Stop: $local_fs $syslog $remote_fs
8
# Default-Start: 2 3 4 5
10
# Short-Description: start and stop cpufreqd
11
# Description: fully configurable daemon for dynamic frequency
15
# Startup script for the cpufreqd daemon. It's been made using the
16
# skeleton example file to build /etc/init.d/ scripts.
17
# This file should be used to construct scripts for /etc/init.d.
19
# Written by Miquel van Smoorenburg <miquels@cistron.nl>.
20
# Modified for Debian GNU/Linux
21
# by Ian Murdock <imurdock@gnu.ai.mit.edu>.
23
# Version: @(#)skeleton 1.9.1 08-Apr-2002 miquels@cistron.nl
26
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
27
DAEMON=/usr/sbin/cpufreqd
28
CPUFREQD_CONFFILE=/etc/cpufreqd.conf
30
DESC="CPU Frequency daemon"
33
. /lib/lsb/init-functions
36
test -r /etc/default/cpufreqd && . /etc/default/cpufreqd
38
# abort if no executable exists
39
test -x $DAEMON || exit 0
41
#abort if no conffile exists
42
test -r $CPUFREQD_CONFFILE || exit 0
44
load_governor_modules() {
45
case "$CPUFREQ_GOV_MODULES" in
50
CPUFREQ_GOV_MODULES=$(cat /etc/cpufreqd.conf | \
51
sed -ne 's/^policy=\([[:alpha:]]*\)/cpufreq_\1/p' | \
57
modprobe -qa $CPUFREQ_GOV_MODULES || /bin/true
61
if [ -n "$CPUFREQ_CPU_MODULE" ] ; then
62
modprobe -q $CPUFREQ_CPU_MODULE || /bin/true
66
check_for_cpufreq_support() {
67
# forget it if we're trying to start and no cpufreq found in kernel
68
if !([ -d /sys/devices/system/cpu/cpu0/cpufreq ] || [ -f /proc/cpufreq ]) ; then
69
# log_failure_msg "no cpufreq interface found. "
80
log_daemon_msg "Starting $DESC" "$NAME"
83
if check_for_cpufreq_support ; then
84
start_daemon $DAEMON -f $CPUFREQD_CONFFILE
86
# log_failure_msg " Errors occurred starting cpufreqd"
92
log_daemon_msg "Stopping $DESC" "$NAME"
93
if ( pidofproc $DAEMON 2>&1 > /dev/null ) ; then
98
# reload|force-reload)
99
# check_for_cpufreq_support
100
# echo -n "Reloading $DESC configuration..."
101
# start-stop-daemon --stop --oknodo --signal 1 --exec $DAEMON -- -f $CPUFREQD_CONFFILE
104
reload|force-reload|restart)
105
log_daemon_msg "Restarting $DESC" "$NAME"
108
if check_for_cpufreq_support ; then
109
start_daemon $DAEMON -f $CPUFREQD_CONFFILE
111
# log_failure_msg " Errors occurred starting cpufreqd"
118
echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2