3 # lighttpd lighttpd Web Server
6 # description: lighttpd is a World Wide Web server. It is used to serve \
10 # Source function library
11 . /etc/rc.d/init.d/functions
14 . /etc/sysconfig/network
17 [ -f /etc/sysconfig/lighttpd ] && . /etc/sysconfig/lighttpd
19 # Check that networking is up.
20 if is_yes "${NETWORKING}"; then
21 if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
22 msg_network_down lighttpd
30 out=`env SHELL=/bin/sh lighttpd -t -f /etc/lighttpd/lighttpd.conf $HTTPD_OPTS 2>&1`
32 if [ "$rc" = 0 ]; then
41 # See how we were called.
44 # Check if the service is already running?
45 if [ ! -f /var/lock/subsys/lighttpd ]; then
48 daemon env SHELL=/bin/sh lighttpd -f /etc/lighttpd/lighttpd.conf $HTTPD_OPTS
50 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/lighttpd
52 msg_already_running lighttpd
57 if [ -f /var/lock/subsys/lighttpd ]; then
59 killproc --pidfile /var/run/lighttpd.pid lighttpd
60 rm -f /var/lock/subsys/lighttpd >/dev/null 2>&1
62 msg_not_running lighttpd
70 if [ -f /var/lock/subsys/lighttpd ]; then
73 # sending INT signal will make lighttpd close all listening sockets and
74 # wait for client connections to terminate.
75 killproc --pidfile /var/run/lighttpd.pid lighttpd -INT
76 rm -f /var/lock/subsys/lighttpd >/dev/null 2>&1
81 # this is not reload. it will just reopen logs
82 if [ -f /var/lock/subsys/lighttpd ]; then
83 msg_reloading lighttpd
85 killproc --pidfile /var/run/lighttpd.pid lighttpd -HUP
88 msg_not_running lighttpd
93 msg_usage "$0 {start|stop|restart|reload|force-reload|graceful|status}"