Re: advice on how to detect time change



On Sep 27, 10:47 am, John Hasler <j...@xxxxxxxxxx> wrote:
I wrote:
Put an NTP client into your program.
d_cymbal writes:
Perhaps I didn't phrase that question correctly.

You phrased it correctly. You just left of the details. Putting an NTP
client in your program and having it query a reliable time server would
allow it to detect changes in the local system time.

My application doesn't care what the system time is, or care that it is
correct, but it does need to detect if some external entity changes the
time out from under it (this is a master device which must globally
update slave devices with a time change if the user (or some other force
such as ntp) changes the time on the master system.

Then your program need not deal with system time at all. You should
install an NTP package such as Ntp or Chrony on the master and on each
slave and configure the slaves to track the master. This is exactly the
sort of thing that NTP is for.
--
John Hasler
j...@xxxxxxxxxx
Dancing Horse Hill
Elmwood, WI USA

OK: to be more explicit: I *cannot* run an NTP client on the slave
devices. It is not now, nor ever will be, an option. There is a
possibility to run NTP on the master devices which is why I am asking
this question. The master device can run NTP and keep its clock in
sync. The master can notify the slaves of a time change through a
proprietary mechanism. The slaves cannot run NTP themselves. So, I
need a mechanism for the master device to detect that something, be it
the NTP client, the user, or whatever, has changed its local system
time so that it can proxy this event through to the slaves. I was
trying to avoid having the slaves constantly poll the master for
changes as the desire would be for a time change on the master to
trickle through the system in fairly short order (does not need to be
real time) and I did not want the slaves polling constantly with short
frequencies (or conversely have the master sending frequent updates).
My hope was to be able to detect the change on the master and then
push the update to the slaves through the proprietary channel.

.



Relevant Pages

  • Re: advice on how to detect time change
    ... proprietary mechanism. ... The slaves cannot run NTP themselves. ... I need a mechanism for the master device to detect that ...
    (comp.os.linux.development.apps)
  • Re: "ntpd -q" is slow compared to ntpdate
    ... on why 'ntpd -q -g' is slow. ... progress if the external NTP server was down. ... So the slaves need to quickly ... update the clock to roughly the same time as the master, ...
    (comp.protocols.time.ntp)
  • Re: advice on how to detect time change
    ... time out from under it (this is a master device which must globally ... update slave devices with a time change if the user (or some other force ... such as ntp) changes the time on the master system. ...
    (comp.os.linux.development.apps)
  • Re: [RFC/PATCH 0/22] W1: sysfs, lifetime and other fixes
    ... defined in family driver. ... Bus master driver - is like NIC driver, it does not know about the rest ... It has it's logical slaves, it has it's own attributes and features, ... This is wrong - netlink notification is used and will be moved to ...
    (Linux-Kernel)
  • Re: tcl and threads: installing and other info
    ... So I'd like to parallelise the notification processing. ... a event based master process using ... more stable in case one of the slaves crashes or does nasty things. ... If you don't have enough memory for the database to do its ...
    (comp.lang.tcl)