2 # The following two lines enable chkconfig(1) to manipulate this script
3 # chkconfig: 2345 99 01
4 # description: control Jef Poskanzer's tiny/turbo/throttling http daemon
6 # source function library
7 .
/etc
/rc.d
/init.d
/functions
9 pidfile
=/var
/run
/thttpd.pid
10 pid
=`cat $pidfile 2>/dev/null`
12 if test -n "$pid" && kill -0 $pid 2>/dev
/null
; then
19 echo -n "$*"; echo_failure
; echo ''
24 start
) test "$dead" = yes || die thttpd is already running
25 echo -n "Starting thttpd: "
26 daemon
/usr
/sbin
/thttpd
-C /etc
/thttpd.conf
27 touch /var
/lock
/subsys
/thttpd
31 stop
) echo -n "Gently shutting down thttpd: "
34 kill) echo -n "Violently killing thttpd: "
37 status
) status thttpd
; exit $?
;;
38 restart
) $0 stop
; sleep 2; exec $0 start
;;
39 *) die
"Usage: thttpd {start|stop|restart|status}";;
42 test "$dead" = no || die thttpd is not running
45 kill -0 $pid 2>/dev
/null
&& die
"thttpd[$pid] will not die"
46 rm -f /var
/lock
/subsys
/thttpd