9 pidof
-o %PPID
/usr
/bin
/$daemon_name
14 stat_busy
"Starting $daemon_name daemon"
17 if [ -z "$PID" ]; then
18 [ -f /var
/run
/$daemon_name.pid
] && rm -f /var
/run
/$daemon_name.pid
20 nohup
$daemon_name >> /var
/log
/mpdas.log
&
26 echo $
(get_pid
) > /var
/run
/$daemon_name.pid
27 add_daemon
$daemon_name
37 stat_busy
"Stopping $daemon_name daemon"
40 [ ! -z "$PID" ] && kill $PID &> /dev
/null
46 rm -f /var
/run
/$daemon_name.pid
&> /dev
/null
47 rm_daemon
$daemon_name
58 echo "usage: $0 {start|stop|restart}"