Try to avoid conflicting with other lighttpd config that

touches the stat cache settings.
This commit is contained in:
Oliver Jowett 2016-09-22 16:45:28 +01:00
parent abc30ff656
commit cfb02c1a7c
4 changed files with 29 additions and 7 deletions

View file

@ -34,6 +34,15 @@ case "$1" in
# set up lighttpd # set up lighttpd
echo "Enabling lighttpd integration.." >&2 echo "Enabling lighttpd integration.." >&2
lighty-enable-mod dump1090-fa || true lighty-enable-mod dump1090-fa || true
# only enable the statcache config if there is nothing else around that already
# configures it, because lighttpd fails if it's configured twice
if ! grep -q -E '^\S*server.stat-cache-engine' /etc/lighttpd/conf-enabled/*.conf
then
echo "Enabling lighttpd integration (stat cache).." >&2
lighty-enable-mod dump1090-fa-statcache || true
fi
echo "Restarting lighttpd.." >&2 echo "Restarting lighttpd.." >&2
invoke-rc.d lighttpd restart || true invoke-rc.d lighttpd restart || true
;; ;;

View file

@ -25,9 +25,23 @@ case "$1" in
;; ;;
remove) remove)
if [ -e /etc/lighttpd/conf-enabled/89-dump1090.conf ]; then changed=false
if [ -e /etc/lighttpd/conf-enabled/89-dump1090-fa.conf ]
then
echo "Disabling lighttpd integration.." >&2 echo "Disabling lighttpd integration.." >&2
lighty-disable-mod dump1090 || true lighty-disable-mod dump1090-fa || true
changed=true
fi
if [ -e /etc/lighttpd/conf-enabled/88-dump1090-fa-statcache.conf ]
then
echo "Disabling lighttpd integration (stat cache).." >&2
lighty-disable-mod dump1090-fa-statcache || true
changed=true
fi
if $changed
then
echo "Restarting lighttpd.." >&2 echo "Restarting lighttpd.." >&2
invoke-rc.d lighttpd restart || echo "Warning: lighttpd failed to restart." >&2 invoke-rc.d lighttpd restart || echo "Warning: lighttpd failed to restart." >&2
fi fi

View file

@ -0,0 +1,4 @@
# The stat cache must be disabled, as aircraft.json changes
# frequently and lighttpd's stat cache often ends up with the
# wrong content length.
server.stat-cache-engine = "disable"

View file

@ -7,11 +7,6 @@ alias.url += (
"/dump1090-fa/" => "/usr/share/dump1090-fa/html/" "/dump1090-fa/" => "/usr/share/dump1090-fa/html/"
) )
# The stat cache must be disabled, as aircraft.json changes
# frequently and lighttpd's stat cache often ends up with the
# wrong content length.
server.stat-cache-engine = "disable"
# Listen on port 8080 and emit 301s pointing to port 80 # Listen on port 8080 and emit 301s pointing to port 80
# to support the old convention of the map being on 8080 # to support the old convention of the map being on 8080
$SERVER["socket"] == ":8080" { $SERVER["socket"] == ":8080" {