9 PID
=`pgrep -u $daemon_name`
13 #Check if db and redis are running, start them if not
14 ck_daemon
-DB- && /etc
/rc.d
/-DB- start
15 ck_daemon redis
&& /etc
/rc.d
/redis start
17 if [ ! -e /var
/log
/$daemon_name.log
]; then
18 touch /var
/log
/$daemon_name.log
19 chown
$dusr:$dusr /var
/log
/$daemon_name.log
22 stat_busy
"Starting $daemon_name daemon"
23 [ -z "$PID" ] && /bin
/su
- $dusr -c "/usr/bin/$daemon_name &"
28 add_daemon
$daemon_name
34 stat_busy
"Stopping $daemon_name daemon"
40 while [ ! -z "$(pgrep -u $daemon_name)" ]; do
43 rm_daemon
$daemon_name
55 stat_busy
"Checking $daemon_name status"
56 ck_status
$daemon_name
60 echo "usage: $0 {start|stop|restart|status}"