From eb2ee6855c7b43096c399786f03a907c699f5774 Mon Sep 17 00:00:00 2001 From: pbern Date: Sun, 27 Jun 2004 16:33:20 +0000 Subject: [PATCH] - init Changed files: cpudyn.conf -> 1.1 cpudyn.init -> 1.1 --- cpudyn.conf | 54 +++++++++++++++++++++++++++++++++++++++++++++++ cpudyn.init | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 115 insertions(+) create mode 100644 cpudyn.conf create mode 100644 cpudyn.init diff --git a/cpudyn.conf b/cpudyn.conf new file mode 100644 index 0000000..0b81054 --- /dev/null +++ b/cpudyn.conf @@ -0,0 +1,54 @@ +# Cpudyn configure options + +################################################ +# COMMON OPTIONS +################################################ + +# +# Internal between idle ratio tests in 1/10 sec increments +# + +INTERVAL=1 + +################################################ +# CPUFREQ OPTIONS +################################################ + +# +# CPU idle work ratio to speed up +# + +CPU_UP=0.5 + +# +# CPU idle work ratio to speed down +# + +CPU_DOWN=0.9 + +# +# when using cputhrottling, what state to switch when speeding down +# + +THROTTLING_LOW=7 + +################################################ +# DISK OPTIONS +# (disabled by default) +################################################ + +# +# Timeout to put the disk in standby mode if there was no +# io during that period (in seconds) +# + +# TIMEOUT=120 + +# +# Specified disks to spindown (comma separated devices) +# + +# DISKS=/dev/hda,/dev/hdb + + + diff --git a/cpudyn.init b/cpudyn.init new file mode 100644 index 0000000..af601b0 --- /dev/null +++ b/cpudyn.init @@ -0,0 +1,61 @@ +#! /bin/sh +# +# Written by Celso Gonzalez . +# +# based in skeleton example file provided by Debian. +# +# Version: @(#)cpudyn 0.4.0 30-Jul-2003 celso@bulma.net +# + +PATH=/sbin:/bin:/usr/sbin:/usr/bin +DAEMON=/sbin/cpudynd +NAME=cpudyn +DESC=cpudyn +CONFFILE=/etc/cpudyn.conf +PIDFILE=/var/run/$NAME.pid + +test -x $DAEMON || exit 0 +test -e $CONFFILE || exit 0 + +# Read the configuration file +. $CONFFILE + +OPTS="" +if [ ! -z "$INTERVAL" ]; then OPTS="$OPTS -i $INTERVAL"; fi +if [ ! -z "$CPU_UP" -a ! -z "$CPU_DOWN" ]; then OPTS="$OPTS -p $CPU_UP $CPU_DOWN"; fi +if [ ! -z "$THROTTLING_LOW" ]; then OPTS="$OPTS -l $THROTTLING_LOW"; fi +if [ ! -z "$TIMEOUT" ]; then OPTS="$OPTS -t $TIMEOUT"; fi +if [ ! -z "$DISKS" ]; then OPTS="$OPTS -h $DISKS"; fi + +set -e + +case "$1" in + start) + echo -n "Starting $DESC: " + start-stop-daemon --start --quiet --pidfile $PIDFILE \ + --background --make-pidfile --exec $DAEMON -- $OPTS + echo "$NAME." + ;; + stop) + echo -n "Stopping $DESC: " + start-stop-daemon --stop --quiet --pidfile $PIDFILE \ + --exec $DAEMON && rm -f $PIDFILE + echo "$NAME." + ;; + restart|force-reload) + echo -n "Restarting $DESC: " + start-stop-daemon --stop --quiet --pidfile $PIDFILE \ + --exec $DAEMON && rm -f $PIDFILE + sleep 1 + start-stop-daemon --start --quiet --pidfile $PIDFILE \ + --background --make-pidfile --exec $DAEMON -- $OPTS + echo "$NAME." + ;; + *) + N=/etc/init.d/$NAME + echo "Usage: $N {start|stop|restart|force-reload}" >&2 + exit 1 + ;; +esac + +exit 0 -- 2.44.0