[Voyage-linux] Re: Saving date with voyage-sync

Punky Tse (spam-protected)
Sun Aug 14 23:44:07 HKT 2011


Hi Teco,

Question, why not /etc/init.d/voyage-util?


On 12/8/2011 23:56, Teco Boot wrote:
> 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
>
>


-- 

Regards,
Kim-man "Punky" Tse

* Open Source Embedded Solutions and Systems
   - Voyage Linux (http://linux.voyage.hk)
   - Voyage ONE   (http://linux.voyage.hk/voyage-one)
   - Voyage MPD   (http://linux.voyage.hk/voyage-mpd)
* Voyage Store   (http://store.voyage.hk)





More information about the Voyage-linux mailing list