From dc92cfb9279d0f3b23c6fde1c38f77b0e302b415 Mon Sep 17 00:00:00 2001 From: Oliver Jowett Date: Wed, 14 Jan 2015 00:34:06 +0000 Subject: [PATCH] Restart lighttpd on package upgrade if we changed its config files. --- debian/changelog | 1 + debian/dump1090-mutability.postinst | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/debian/changelog b/debian/changelog index bd5dd00..fa617c0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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 Sun, 11 Jan 2015 11:53:48 +0000 diff --git a/debian/dump1090-mutability.postinst b/debian/dump1090-mutability.postinst index bb57a7a..d33d600 100644 --- a/debian/dump1090-mutability.postinst +++ b/debian/dump1090-mutability.postinst @@ -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)