Check lighttpd.conf on restart
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
lighttpd (Debian) |
Fix Released
|
Unknown
|
|||
lighttpd (Ubuntu) |
Fix Released
|
Wishlist
|
Daniel Hahler |
Bug Description
Binary package hint: lighttpd
Description: Ubuntu 8.04.1
Release: 8.04
rvdm@serpent:~$ apt-cache policy lighttpd
lighttpd:
Installed: 1.4.19-0ubuntu3
Candidate: 1.4.19-0ubuntu3
Version table:
*** 1.4.19-0ubuntu3 0
500 http://
100 /var/lib/
When restarting lighty using /etc/init.
As lighttpd configuration can be quite complicated, it would be advisable to do checking similar to the checks used in the apache packages. Lighttpd supports a configuration check using the lighttpd -t command.
I just wanted to report this to get it out of my head; If patches are required, I'd be happy to supply them.
Related branches
Changed in lighttpd (Debian): | |
importance: | Undecided → Unknown |
status: | New → Unknown |
Changed in lighttpd (Debian): | |
status: | Unknown → New |
Changed in lighttpd (Debian): | |
status: | New → Fix Released |
I'd like to endorse this... here's the diff from our patched version:
--- lighttpd 2009-02-11 00:50:12.000000000 -0800
+++ changed 2009-02-11 00:57:36.000000000 -0800
@@ -31,8 +31,15 @@
. /lib/lsb/ init-functions
+function syntax_check force-reload)
+{
+$DAEMON $DAEMON_OPTS -t
+[ $? -ne 0 ] || exit 1
+}
+
case "$1" in
start)
+ syntax_check
log_daemon_msg "Starting $DESC" $NAME
if ! $ENV $SSD --start --quiet\
--pidfile $PIDFILE --exec $DAEMON -- $DAEMON_OPTS ; then
@@ -52,6 +59,7 @@
fi
;;
reload)
+ syntax_check
log_daemon_msg "Reloading $DESC configuration" $NAME
if $SSD --stop --signal 2 --oknodo --retry 30\
--quiet --pidfile $PIDFILE --exec $DAEMON; then
@@ -66,6 +74,7 @@
fi
;;
restart|
+ syntax_check
$0 stop
[ -r $PIDFILE ] && while pidof lighttpd |\
grep -q `cat $PIDFILE 2>/dev/null` 2>/dev/null ; do sleep 1; done
## ENDS