From b064c5c209e99d97c825ecfab42bc8b2e3bced54 Mon Sep 17 00:00:00 2001 From: Petr Štetiar Date: Mon, 28 Nov 2016 15:12:11 +0100 Subject: luci-mod-admin-full: Store system time into RTC also MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We're currently just setting system time, but we don't set battery backed RTC. Time in the RTC is only set on the graceful shutdown, which is quite hard to achieve on embedded devices. In other words, on systems with battery backed RTC we currently don't handle following use case properly: 1. Set system time from web UI (sets only system time, but not RTC) 2. Unplug the device from power Then after the reboot, we've wrong system time again, because time set in [1] is not saved to battery backed RTC. Signed-off-by: Petr Štetiar --- modules/luci-mod-admin-full/luasrc/controller/admin/system.lua | 1 + 1 file changed, 1 insertion(+) (limited to 'modules/luci-mod-admin-full') diff --git a/modules/luci-mod-admin-full/luasrc/controller/admin/system.lua b/modules/luci-mod-admin-full/luasrc/controller/admin/system.lua index cf8cfb5d2..5478afa3e 100644 --- a/modules/luci-mod-admin-full/luasrc/controller/admin/system.lua +++ b/modules/luci-mod-admin-full/luasrc/controller/admin/system.lua @@ -52,6 +52,7 @@ function action_clock_status() luci.sys.call("date -s '%04d-%02d-%02d %02d:%02d:%02d'" %{ date.year, date.month, date.day, date.hour, date.min, date.sec }) + luci.sys.call("/etc/init.d/sysfixtime restart") end end -- cgit v1.2.3