4 pid_file
="/var/run/$daemon_name.pid"
5 daemon_full_path
="/usr/bin/$daemon_name"
10 #. /etc/conf.d/$daemon_name.conf
13 pidof
-x -o %PPID
$daemon_full_path
18 stat_busy
"Starting $daemon_name daemon"
21 if [ -z "$PID" ]; then
22 [ -f /var
/run
/$daemon_name.pid
] && rm -f /var
/run
/$daemon_name.pid
24 $daemon_full_path $daemon_args &
30 # Create a PID file if the daemon did not
31 if [ ! -f "$pid_file" ]; then
32 echo $
(get_pid
) > $pid_file
34 add_daemon
$daemon_name
44 stat_busy
"Stopping $daemon_name daemon"
47 [ ! -z "$PID" ] && kill $PID &> /dev
/null
48 # The runvdr script may not kill vdr on exit so do it here
49 killall
--quiet --wait vdr
55 rm -f $pid_file &> /dev
/null
56 rm_daemon
$daemon_name
68 stat_busy
"Checking $daemon_name status";
69 ck_status
$daemon_name
73 echo "usage: $0 {start|stop|restart|status}"