On 03/24/2014 11:03 PM, Toke Høiland-Jørgensen wrote: > Phil Pennock <[email protected]> writes: > >> For context, I'm currently running OpenWRT; attached is the >> /etc/init.d/ntpdate which I'm using. It relies upon having Python and >> dig installed, as I haven't gotten around to building a small C >> utility to do just this task, but perhaps the approach is useful >> enough that someone else might do so? > > A functionality similar to this is already implemented in openwrt and > runs as the first thing on boot. It finds the newest file in /etc and > sets the system time to that: > > # cat /etc/init.d/sysfixtime > #!/bin/sh /etc/rc.common > # Copyright (C) 2013-2014 OpenWrt.org > > START=00 > > boot() { > local curtime="$(date +%s)" > local maxtime="$(find /etc -type f -exec date +%s -r {} \; | sort -nr | > head -n1)" > [ $curtime -lt $maxtime ] && \ > date -s @$maxtime && \ > logger -t sysfixtime -p daemon.notice "Time fixed" > } >
I haven't upgraded to -12 yet (still on -9), but logread doesn't seem to get its time updated: Sat Jan 17 03:41:38 1970 authpriv.notice dropbear[3747]: Pubkey auth succeeded for 'root' with key md5 2a:6d:49:b6:74:91:9c:34:f8:7a:2e:40:65:b2:e9:e9 from 172.30.42.12:52391 Although the date is right: # date Mon Mar 24 22:05:20 GMT 2014 I tried running sysfixtime manually, or just run the 'date -s <unix-timestamp>' manually, with no luck. Any idea how to get logread (or well the daemon/kernel) to update its timestamps? Best regards, --Edwin _______________________________________________ Cerowrt-devel mailing list [email protected] https://lists.bufferbloat.net/listinfo/cerowrt-devel
