busybox ntpd does not resync date/time after changing it

5.2k Views Asked by At

I'm trying to figure out how ntpd (from busybox) works. I'm running the following scenario, for a test sake:

  1. set up date/time, using date -s, to any arbitrary date/time (e.g. 2000-01-01 00:00:00);
  2. run the command ntpd -N -p <server_address> to start the daemon. Just after that, the date/time is successfully sync;
  3. change the date/time againt, using date -s, to the same used in the 1st step (i.e. 2000-01-01 00:00:00);

After that, I have been expecting that date/time was synchronized again, but this doesn't occur, even if I wait for a couple of hours.

My question is: my comprehension about the ntpd's behavior is correct? Should the date/time be resync automatically after the 3rd step? If not, what should I do to resync the date/time?

1

There are 1 best solutions below

0
urnenfeld On

I would check internaly in the trimmed busybox implementation if the use case is actually covered. Some options could be actually ignored and that can cause confusion.

If not, in case it is a yocto based embedded system, you should consider bring the actual and complete ntpd instead of the busybox one.