4 pid_file
=/var
/run
/$daemon_name/$daemon_name.pid
7 source /etc
/rc.d
/functions
10 if [ -f $pid_file ]; then
11 /bin
/kill -0 $
(cat $pid_file)
20 stat_busy
"Starting $daemon_name daemon"
23 if [ -z "$PID" ]; then
24 [ -f $pid_file ] && rm -f $pid_file
25 prosodyctl start
> /dev
/null
30 add_daemon
$daemon_name
35 printhl
"$daemon_name is already running"
41 stat_busy
"Stopping $daemon_name daemon"
43 if [ ! -z "$PID" ]; then
44 prosodyctl stop
> /dev
/null
49 rm -f $pid_file &> /dev
/null
50 rm_daemon
$daemon_name
55 printhl
"$daemon_name is not running"
66 stat_busy
"Reloading $daemon_name"
68 if [ ! -z "$PID" ]; then
69 /bin
/kill -HUP $PID 2> /dev
/null
78 printhl
"$daemon_name is not running"
83 stat_busy
"Checking $daemon_name status";
84 ck_status
$daemon_name
88 echo "usage: $0 {start|stop|restart|reload|status}"