]> git.pld-linux.org Git - packages/apmud.git/commitdiff
- copied from pmud*.* for apmud
authorwrobell <wrobell@pld-linux.org>
Sun, 26 Sep 2004 22:34:23 +0000 (22:34 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    apmud-pwrctl.patch -> 1.1
    apmud.init -> 1.1

apmud-pwrctl.patch [new file with mode: 0644]
apmud.init [new file with mode: 0755]

diff --git a/apmud-pwrctl.patch b/apmud-pwrctl.patch
new file mode 100644 (file)
index 0000000..2723d57
--- /dev/null
@@ -0,0 +1,74 @@
+diff -Naur pmud-0.10.orig/pwrctl pmud-0.10/pwrctl
+--- pmud-0.10.orig/pwrctl      Sun Dec 16 10:43:30 2001
++++ pmud-0.10/pwrctl   Thu Jun 20 00:55:48 2002
+@@ -73,20 +73,20 @@
+       case "$1" in
+       minimum)
+               # min power, set disk to spin down after 1 minute
+-              hdparm -p -S 12 /dev/hda
++              /sbin/hdparm -p -S 12 /dev/hda
+       ;;
+       medium)
+-              hdparm -p -S 12 /dev/hda
++              /sbin/hdparm -p -S 12 /dev/hda
+       ;;
+       maximum)
+               case "$2" in
+               ac)
+                       # on mains, do not spin down
+-                      hdparm -p -S 0 /dev/hda
++                      /sbin/hdparm -p -S 0 /dev/hda
+               ;;
+               *)
+                       # on battery, set disk to spin down after 5 minute
+-                      hdparm -p -S 60 /dev/hda
++                      /sbin/hdparm -p -S 60 /dev/hda
+               ;;
+               esac
+       ;;
+@@ -112,7 +112,7 @@
+                               done
+                               ))
+                               [ ! -z "$device" ] && {
+-                                      /sbin/wakebay /dev/${device}
++                                      /usr/sbin/wakebay /dev/${device}
+                               }
+               }
+       ;;
+@@ -135,14 +135,14 @@
+       case "$1" in
+       minimum)
+               ifconfig eth0 down
+-              hdparm -d0 -S 12 /dev/hda
+-              hdparm -d0 /dev/hdc
++              /sbin/hdparm -d0 -S 12 /dev/hda
++              /sbin/hdparm -d0 /dev/hdc
+               echo 1 >/proc/sys/kernel/powersave-nap
+       ;;
+       medium)
+               echo 0 >/proc/sys/kernel/powersave-nap
+-              hdparm -d1 -p -S 12 /dev/hda
+-              hdparm -d1 /dev/hdc
++              /sbin/hdparm -d1 -p -S 12 /dev/hda
++              /sbin/hdparm -d1 /dev/hdc
+               ifconfig eth0 up
+       ;;
+       maximum)
+@@ -150,14 +150,14 @@
+               case "$2" in
+               ac)
+                       # on mains, do not spin down
+-                      hdparm -d1 -p -S 0 /dev/hda
++                      /sbin/hdparm -d1 -p -S 0 /dev/hda
+               ;;
+               *)
+                       # on battery, set disk to spin down after 5 minute
+-                      hdparm -d1 -p -S 60 /dev/hda
++                      /sbin/hdparm -d1 -p -S 60 /dev/hda
+               ;;
+               esac
+-              hdparm -d1 /dev/hdc
++              /sbin/hdparm -d1 /dev/hdc
+               ifconfig eth0 up
+       ;;
+       warning)
diff --git a/apmud.init b/apmud.init
new file mode 100755 (executable)
index 0000000..ff3fb3c
--- /dev/null
@@ -0,0 +1,61 @@
+#!/bin/sh
+# $Id$
+#
+# pmud         Power Manager daemon for Apple powerbooks
+#
+# chkconfig:   2345 40 60
+# description: pmud is a daemon which periodically polls the PMU \
+#              (power manager) and performs functions such as enabling \
+#              or disabling devices appropriately when the power source \
+#              changes.
+#
+# config:      /etc/sysconfig/power
+
+# Source function library
+. /etc/rc.d/init.d/functions
+
+# Get service config
+if [ -f /etc/sysconfig/pmud ]; then
+       . /etc/sysconfig/pmud
+fi
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+  start)
+       # Check if service is already running?
+       if [ ! -f /var/lock/subsys/pmud ]; then
+               
+               # try load event module
+               msg_starting "pmud"
+               daemon pmud $PMUD_FLAGS
+               RETVAL=$?
+               [ $RETVAL -eq 0 ] && touch /var/lock/subsys/pmud
+       else
+               msg_already_running "pmud"
+       fi
+       ;;
+  stop)
+       if [ -f /var/lock/subsys/pmud ]; then
+               msg_stopping "pmud"
+               killproc pmud
+               rm -f /var/lock/subsys/pmud
+       else
+               msg_not_running pmud
+       fi
+       ;;
+  status)
+       status pmud
+       exit $?
+       ;;
+  restart|force-reload)
+       $0 stop
+       $0 start
+       exit $?
+       ;;
+  *)
+       msg_usage "$0 {start|stop|restart|force-reload|status}"
+       exit 3
+esac
+
+exit $RETVAL
This page took 0.079552 seconds and 4 git commands to generate.