Hi Punky, Op 14 aug 2011, om 17:44 heeft Punky Tse het volgende geschreven:
> Hi Teco, > > Question, why not /etc/init.d/voyage-util? - voyage-util is started after other daemons. Updating clock that late may have unexpected side effects. - Saving clock in tmpfs must go hand in hand with syncing tmpfs. - It requires no additional trigger for saving the clock (and syncing tmpfs afterwards). - Updating clock before restoring saved tmpfs files eliminates some error messages (not the strongest argument :-). Thanks, Teco > > 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@Voyage:/etc/init.d# remountrw >> root@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@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) > _______________________________________________ Voyage-linux mailing list [email protected] http://list.voyage.hk/mailman/listinfo/voyage-linux
