Re: [chrony-users] Best way to force clock step at shutdown

[ Thread Index | Date Index | More chrony.tuxfamily.org/chrony-users Archives ]


On Tue, Jan 12, 2016 at 11:58:30AM +0100, Hector Oron wrote:
>   The recommended way to be able to force a sync is to generate a
> burst and wait 10 sec for measurements to complete, then do the
> stepping on the clock.
> 
>   My requirements need to sync time only at shutdown, but time cannot
> change during machine activity, if I do the burst, sleep, makestep at
> shutdown it works, but I would prefer to not have to wait.

You don't want to wait to make the process faster or not wait for some
arbitrary number of seconds in the script to make it cleaner?

If measurements were made not too long before the shutdown, i.e.
chronyd knows the current offset and is correcting it by slewing 
you just need to call chronyc -a makestep to force it to step the
clock.

Another possibility is to stop chronyd and start it again with the -q
option (ntpdate mode) to just step the clock and exit. If the servers
are specified with the iburst option, chronyd -q should exit in about
5 seconds.

>   What I am planning to do is to have a systemd unit file that
> triggers the burst at machine startup, then does the makestep at
> shutdown, that way I believe clock should only step at shutdown
> correctly without modifying time during machine activity.

So the idea is to correct the system clock before shutdown so the RTC
can be set to it (e.g. by hwclock), and the next time the machine
boots the system time won't be too far from the true time?

-- 
Miroslav Lichvar

-- 
To unsubscribe email chrony-users-request@xxxxxxxxxxxxxxxxxxxx 
with "unsubscribe" in the subject.
For help email chrony-users-request@xxxxxxxxxxxxxxxxxxxx 
with "help" in the subject.
Trouble?  Email listmaster@xxxxxxxxxxxxxxxxxxxx.


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/