+ if [ $RETVAL -eq 0 ]; then
+ ok
+ touch /var/lock/subsys/lighttpd
+ else
+ fail
+ fi
+}
+
+stop() {
+ # Stop daemons.
+ if [ ! -f /var/lock/subsys/lighttpd ]; then
+ msg_not_running "Lighttpd Web Server"
+ return
+ fi
+
+ msg_stopping "Lighttpd Web Server"
+ killproc --pidfile /var/run/lighttpd.pid lighttpd
+ rm -f /var/lock/subsys/lighttpd >/dev/null 2>&1
+ rm -f /var/run/lighttpd*.pid >/dev/null 2>&1
+}
+
+restart() {
+ local pid
+
+ # short circuit to safe reload if pid exists and is alive
+ if is_yes "${LIGHT_ANGEL}"; then
+ if [ -f /var/lock/subsys/lighttpd ] && pid=$(pidofproc lighttpd-angel lighttpd-angel.pid) && checkpid $pid; then
+ reload
+ return
+ fi
+ else
+ if [ -f /var/lock/subsys/lighttpd ] && pid=$(pidofproc lighttpd lighttpd.pid) && checkpid $pid; then
+ reload
+ return
+ fi
+ fi
+
+ checkconfig
+ stop
+ start
+}
+
+reload() {
+ # TODO: check if process is running. Start it in this case.
+ if [ ! -f /var/lock/subsys/lighttpd ]; then
+ msg_not_running "Lighttpd Web Server"
+ RETVAL=7
+ return
+ fi
+
+ checkconfig 1
+ msg_reloading "Lighttpd Web Server"
+
+ if is_yes "${LIGHT_ANGEL}"; then
+ # sending HUP signal to angel will make lighttpd close all listening
+ # sockets and wait for client connections to terminate. After that new
+ # child will be started
+ killproc lighttpd-angel -HUP
+ else