diff mbox

[OpenWrt-Devel] base-files: sbin/sysupgrade preserve dnsmasq.time

Message ID 1443096062-22694-1-git-send-email-kevin@darbyshire-bryant.me.uk
State Superseded, archived
Headers show

Commit Message

Kevin Darbyshire-Bryant Sept. 24, 2015, 12:01 p.m. UTC
dnsmasq uses /etc/dnsmasq.time as record of the last known good
system time to aid its validation of dnssec timestamps.  dnsmasq
updates the timestamp on process start/stop once it considers the system
time as valid. The timestamp file should be preserved across system
upgrade but should not be included as part of normal configuration
backups to prevent restores corrupting the current timestamps.

Signed-off-by: Kevin Darbyshire-Bryant <kevin@darbyshire-bryant.me.uk>
---
 package/base-files/files/sbin/sysupgrade | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)
diff mbox

Patch

diff --git a/package/base-files/files/sbin/sysupgrade b/package/base-files/files/sbin/sysupgrade
index 4bc52ea..59f1fad 100755
--- a/package/base-files/files/sbin/sysupgrade
+++ b/package/base-files/files/sbin/sysupgrade
@@ -142,13 +142,12 @@  do_save_conffiles() {
 	}
 	run_hooks "$CONFFILES" $sysupgrade_init_conffiles
 
-#if upgrade with save files and dnsmasq running then stop dnsmasq (to update timestamp)
-#and add /etc/dnsmasq.time to archive
-
-#KevinDB: if its a procd service then: ubus call service list '{"name":"dnsmasq"}' | jsonfilter -e '@.*.instances.instance1.running'
-	if [ $(ubus call service list '{"name":"dnsmasq"}' | jsonfilter -e '@.*.instances.instance1.running') = "true" ]; then
-		/etc/init.d/dnsmasq restart
-		echo "/etc/dnsmasq.time" >>$CONFFILES
+	if [ -z $NEED_IMAGE ]; then
+		if [ $(ubus call service list '{"name":"dnsmasq"}' | jsonfilter -e '@.*.instances.instance1.running') = "true" ]; then
+			/etc/init.d/dnsmasq restart
+			sleep 1
+			echo "/etc/dnsmasq.time" >>$CONFFILES
+		fi
 	fi
 
 	ask_bool 0 "Edit config file list" && vi "$CONFFILES"