Restart lighttpd on package upgrade if we changed its config files.

This commit is contained in:
Oliver Jowett 2015-01-14 00:34:06 +00:00
parent 371f6bb5d4
commit dc92cfb927
2 changed files with 11 additions and 0 deletions

1
debian/changelog vendored
View file

@ -12,6 +12,7 @@ dump1090-mutability (1.10.3010.14mu-11) UNRELEASED; urgency=medium
* Add --max-range parameter. Use it for relative position limits, and to
discard bad position results.
* Display message rate (30 sec average) on the webmap.
* Restart lighttpd on package upgrade if we changed its config files.
-- Oliver Jowett <oliver@mutability.co.uk> Sun, 11 Jan 2015 11:53:48 +0000

View file

@ -99,6 +99,16 @@ case "$1" in
db_get $NAME/run-as-user
adduser --system --home /usr/share/$NAME --no-create-home --quiet "$RET"
fi
# -10 changed the lighttpd config file, but didn't arrange to restart it.
# If we are upgrading from -10 or earlier, and lighttpd is in use,
# restart it.
if [ -e /etc/lighttpd/conf-enabled/89-dump1090.conf ]; then
if dpkg --compare-versions "$2" le "1.10.3010.14mu-10"; then
echo "Restarting lighttpd.." >&2
service lighttpd restart || echo "Warning: lighttpd failed to restart." >&2
fi
fi
;;
abort-upgrade|abort-remove|abort-deconfigure)