4
# Required-Start: $syslog $remote_fs $network
5
# Required-Stop: $syslog $remote_fs $network
8
# Default-Start: 2 3 4 5
10
# Short-Description: Start the lighttpd web server.
11
# Description: Fast and smalle webserver with minimal memory footprint
12
# developed with security in mind HTTP/1.1 compliant caching
17
PATH=/sbin:/bin:/usr/sbin:/usr/bin
18
DAEMON=/usr/sbin/lighttpd
21
PIDFILE=/var/run/$NAME.pid
22
SCRIPTNAME=/etc/init.d/$NAME
24
DAEMON_OPTS="-f /etc/lighttpd/lighttpd.conf"
26
test -x $DAEMON || exit 0
32
$DAEMON -t $DAEMON_OPTS > /dev/null || exit $?
35
if [ "$1" != status ]; then
36
# be sure there is a /var/run/lighttpd, even with tmpfs
37
# The directory is defined as volatile and may thus be non-existing
38
# after a boot (DPM §9.3.2)
39
if ! dpkg-statoverride --list /var/run/lighttpd >/dev/null 2>&1; then
40
install -d -o www-data -g www-data -m 0750 "/var/run/lighttpd"
44
. /lib/lsb/init-functions
49
log_daemon_msg "Starting $DESC" $NAME
50
if ! start-stop-daemon --start --oknodo --quiet \
51
--pidfile $PIDFILE --exec $DAEMON -- $DAEMON_OPTS
59
log_daemon_msg "Stopping $DESC" $NAME
60
if start-stop-daemon --stop --retry 30 --oknodo --quiet \
61
--pidfile $PIDFILE --exec $DAEMON
71
log_daemon_msg "Reloading $DESC configuration" $NAME
72
if start-stop-daemon --stop --signal INT --quiet \
73
--pidfile $PIDFILE --exec $DAEMON
76
if start-stop-daemon --start --quiet \
77
--pidfile $PIDFILE --exec $DAEMON -- $DAEMON_OPTS ; then
87
log_daemon_msg "Reopening $DESC logs" $NAME
88
if start-stop-daemon --stop --signal HUP --oknodo --quiet \
89
--pidfile $PIDFILE --exec $DAEMON
102
status_of_proc -p "$PIDFILE" "$DAEMON" lighttpd && exit 0 || exit $?
105
echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload|status}" >&2