3 daemon_name
="vdradmind"
4 pid_file
="/var/run/$daemon_name/$daemon_name.pid"
5 daemon_full_path
="/usr/bin/$daemon_name"
6 daemon_args
="-p $pid_file"
10 #. /etc/conf.d/$daemon_name.conf
13 pidof
-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
53 rm -f $pid_file &> /dev
/null
54 rm_daemon
$daemon_name
66 stat_busy
"Checking $daemon_name status";
67 ck_status
$daemon_name
71 echo "usage: $0 {start|stop|restart|status}"