3 daemon_bin
=/usr
/sbin
/sleepd
5 daemon_desc
="sleep daemon"
7 test -f $daemon_bin ||
exit 1
13 [ -r /etc
/conf.d
/$daemon_name ] && .
/etc
/conf.d
/$daemon_name
15 #set -e # terminate script on any error?
18 pidof
-o %PPID
$daemon_bin
23 # Ensure apm module is loaded.
24 # test -e /dev/apm_bios && touch /dev/apm_bios
25 # do hal (and acpi) need to be started?
26 ck_daemon hal
&& /etc
/rc.d
/hal start
28 stat_busy
"Starting $daemon_desc"
30 if [ -z "$PID" ]; then
31 [ -f /var
/run
/$daemon_name.pid
] && rm -f /var
/run
/$daemon_name.pid
32 $daemon_bin "${PARAMS[@]}"
34 echo `get_pid` > /var
/run
/$daemon_name.pid
35 add_daemon
$daemon_name
43 stat_busy
"Stopping $daemon_desc"
45 [ ! -z "$PID" ] && kill $PID &> /dev
/null
47 rm -f /var
/run
/$daemon_name.pid
&> /dev
/null
48 rm_daemon
$daemon_name
61 echo "Usage: $0 {start|stop|restart}" >&2