Does NTP daemon(ntpd) provide some sort of virtual clock that it disciplines and serves, but not touch the system clock?
Goal:
On a realtime Linux OS, have a NTP synchronized clock alongside of the system clock, so that ntp time changes won't cause issues on the system, but I can use NTP time for debuging purposes, say for sysloging.
Problem:
We are adding NTP to an already existing system, previously no worries about the system time, but now we are adding NTP to enable better debugging
Setup:
- Some of the applications on the system rely on REALTIME instead of MONOTONIC time
- I have local clock as one of the NTP servers
- By default no external NTP server set
- On boot, ntpd is set to instant sync the system clock to first available non local clock and exit, then start another instance of ntpd normally
- When no external NTP server set, system would just run with ntpd with local clock
Scenario:
- Lets say on boot time no NTP server set, and one decides to not set any NTP server
- Applications are starts running against REALTIME, no problem
- Someone decides to set an NTP server, but not to reboot the system
- Assume the newly added NTP server is good time source better than local clock, but there is an offset(could be a minute, day or even a month)
- If ntpd on the boot is set to allow huge offset stepping, it would do so without problem, but applications on the system could panic(timeout, etc)
- If ntpd on the boot is set to allow only slew, but no stepping, because of the huge offset the system could take forever to sync to the actual NTP server time
ntpd
is pretty careful not to do things that would upset the system, so you may be solving a non-problem.ntpd -x
ntpd
doesn't step the clock, unless you make it; it slews it (as John has noted). Changing the NTP server shouldn't be a problem, unless (a) the new server is wrong, and (b) someone manually steps the clock to it. So forgive me, but this is looking more and more like a non-problem. Or is this your way of telling us that your organisation uses NTP for something other than intended (specifically, synchronising a bunch of servers to a time which isn't the right time)?