6 # Source function library
7 . /etc/rc.d/init.d/functions
10 if grep -q sample /etc/tenshi/tenshi.conf; then
11 echo >&2 "Please configure /etc/tenshi/tenshi.conf before starting. Remove word 'sample' when done."
16 /usr/sbin/tenshi -C -c /etc/tenshi/tenshi.conf
21 # Check if the service is already running?
22 if [ ! -f /var/lock/subsys/tenshi ]; then
24 daemon /usr/sbin/tenshi -c /etc/tenshi/tenshi.conf -P /var/run/tenshi/tenshi.pid
26 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/tenshi
28 msg_already_running tenshi
33 if [ -f /var/lock/subsys/tenshi ]; then
36 rm -f /var/run/tenshi/tenshi.pid /var/lock/subsys/tenshi >/dev/null 2>&1
38 msg_not_running tenshi
43 # See how we were called.
60 if [ -f /var/lock/subsys/tenshi ]; then
62 show "Reloading tenshi configuration and flushing all queues"
63 kill -HUP `cat /var/run/tenshi/tenshi.pid`
65 [ $RETVAL = 0 ] && ok || fail
67 show "The tenshi config file has syntax error, not restarting"; fail
71 msg_not_running tenshi
76 if [ -f /var/lock/subsys/tenshi ]; then
77 echo "Flushing all queues"
78 kill -USR2 `cat /var/run/tenshi/tenshi.pid`
81 msg_not_running tenshi
86 msg_usage "$0 {start|stop|restart|reload|force-reload|status|flush}"