[Voyage-linux] Saving date with voyage-sync
Teco Boot
(spam-protected)
Fri Aug 12 23:56:37 HKT 2011
Hi Punky,
I have made a bypass for wrong system date after power failures.
Wrong dates are annoying: invalid certificates (e.g. OpenVPN), warnings when overriding newer files (e.g. tar).
Instead of default BIOS date / time, it is better to restart with a saved time. Script voyage-sync is a nice place to do so.
I made a patch (attached). Date is only restored when system date year is before 2011. When hwclock restores system time, this takes preference, it is performed earlier. System time doesn't go back in time that much, depending on how frequent voyage-sync sync is ran.
Accept this patch?
Teco
Power cycle:
============
root at Voyage:/etc/init.d# remountrw
root at Voyage:/etc/init.d# ./voyage-sync sync
voyage-sync: Saved system time in /var/log/voyage.saved-date
voyage-sync: Synchronizing tmpfs changed files...
voyage-sync: Sync'ing /var/log to /.sync/var
voyage-sync: Sync'ing /var/tmp to /.sync/var
voyage-sync: Synchronization tmpfs completed
root at Voyage:/etc/init.d# date
Fri Aug 12 15:27:06 GMT 2011
// ==> here forced power cycle //
PC Engines ALIX.6 v0.99j
640 KB Base Memory
261120 KB Extended Memory
// skipped //
voyage-sync: Restored system time to: Fri Aug 12 15:26:53 GMT 2011
voyage-sync: Start tmpfs...
voyage-sync: Checking if recovery from a power failure is needed...
voyage-sync: Recover'ing /.sync/var/log to /var
voyage-sync: /var recovered
voyage-sync: Recover'ing /.sync/var/tmp to /var
voyage-sync: /var recovered
voyage-sync: Will now restart after recovery from a power failure
[ 17.545298] Restarting system.
// skipped //
voyage-sync: Restored system time to: Fri Aug 12 15:26:53 GMT 2011
voyage-sync: Start tmpfs...
voyage-sync: Checking if recovery from a power failure is needed...
voyage-sync: Copying /ro to /rw
voyage-sync: Setting up tmpfs for changed files...
voyage-sync: tmpfs: mount back /lib/init/rw/var/log to /var/log
voyage-sync: tmpfs: mount back /lib/init/rw/var/tmp to /var/tmp
voyage-sync: Start tmpfs completed
Soft reboot:
============
voyage-sync: Saved system time in /var/log/voyage.saved-date
voyage-sync: Synchronizing tmpfs changed files...
voyage-sync: Sync'ing /var/log to /.sync/var
voyage-sync: Sync'ing /var/tmp to /.sync/var
voyage-sync: Synchronization tmpfs completed
voyage-sync: Unmount'ing /var/log
voyage-sync: Sync'ing /.sync/var/log to /var
voyage-sync: Unmount'ing /var/tmp
voyage-sync: Sync'ing /.sync/var/tmp to /var
voyage-sync: Stop tmpfs completed
....
voyage-sync: Start tmpfs...
voyage-sync: Checking if recovery from a power failure is needed...
voyage-sync: Copying /ro to /rw
voyage-sync: Setting up tmpfs for changed files...
voyage-sync: tmpfs: mount back /lib/init/rw/var/log to /var/log
voyage-sync: tmpfs: mount back /lib/init/rw/var/tmp to /var/tmp
voyage-sync: Start tmpfs completed
-------------- next part --------------
A non-text attachment was scrubbed...
Name: voyage-sync-saved.date.patch
Type: application/octet-stream
Size: 1238 bytes
Desc: not available
URL: <http://list.voyage.hk/pipermail/voyage-linux/attachments/20110812/b520c80f/attachment.obj>
More information about the Voyage-linux
mailing list