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"
22 [ -d /var
/run
/$daemon_name ] ||
{ mkdir
-p /var
/run
/$daemon_name ; chown prosody
:prosody
/var
/run
/prosody
; }
24 if [ -z "$PID" ]; then
25 [ -f $pid_file ] && rm -f $pid_file
26 mkdir
-p `dirname $pid_file`
27 prosodyctl start
1>/dev
/null
2>/dev
/null
32 add_daemon
$daemon_name
37 printhl
"$daemon_name is already running"
43 stat_busy
"Stopping $daemon_name daemon"
45 if [ ! -z "$PID" ]; then
46 prosodyctl stop
1>/dev
/null
2>/dev
/null
51 rm -f $pid_file &> /dev
/null
52 rm_daemon
$daemon_name
57 printhl
"$daemon_name is not running"
68 stat_busy
"Reloading $daemon_name"
70 if [ ! -z "$PID" ]; then
71 /bin
/kill -HUP $PID 2> /dev
/null
80 printhl
"$daemon_name is not running"
85 stat_busy
"Checking $daemon_name status";
86 ck_status
$daemon_name
90 echo "usage: $0 {start|stop|restart|reload|status}"