View previous topic :: View next topic |
Author |
Message |
krotuss Apprentice
Joined: 01 Aug 2008 Posts: 221
|
Posted: Fri Jan 05, 2024 10:37 pm Post subject: ntp-client - why does it work? |
|
|
Hi, I have moved away from ntp-client to chronyd on most of my rpis because it failed to set clock at boot and I have to execute "/etc/init.d/ntp-client restart" manually. Except on one, where it actually works reliably. Any thoughts why? |
|
Back to top |
|
|
szatox Advocate
Joined: 27 Aug 2013 Posts: 3154
|
Posted: Sat Jan 06, 2024 12:56 am Post subject: |
|
|
ntp-client is a one-shot program which immediately synchronizes local clock with a server and exits.
Which means that your rpi must actually be on-line before ntp-client starts. Check your network.
Though it does kinda feel like a disabled ntp-client service. A really dumb mistake to make, but it's also equally difficult to spot, for the same reason. |
|
Back to top |
|
|
krotuss Apprentice
Joined: 01 Aug 2008 Posts: 221
|
Posted: Sat Jan 06, 2024 6:32 pm Post subject: |
|
|
szatox wrote: | ntp-client is a one-shot program which immediately synchronizes local clock with a server and exits.
Which means that your rpi must actually be on-line before ntp-client starts. Check your network.
Though it does kinda feel like a disabled ntp-client service. A really dumb mistake to make, but it's also equally difficult to spot, for the same reason. |
ntp-client init.d script depends "after net", so it should start after network. I was thinking that maybe network didn't have time to come up due to dhcp, but it was happening also on boxes with static ip. IIRC service was in status "started" after boot, but clock was not synchronized. Network was also working right after boot, all that was required to sync clock was "/etc/init.d/ntp-client restart". |
|
Back to top |
|
|
szatox Advocate
Joined: 27 Aug 2013 Posts: 3154
|
Posted: Sat Jan 06, 2024 10:08 pm Post subject: |
|
|
You could try sniffing for traffic on 123/udp, maybe there's something interfering during boot. Actually, if you opt for a sniffer, log 53/udp too.
Also, ntp-client could have written some logs, it's worth checking up too.
Of course ntp-client should start after net; it should also set the clock, which doesn't happen, so we're looking for the point where the reality stops meeting our expectations, right? |
|
Back to top |
|
|
krotuss Apprentice
Joined: 01 Aug 2008 Posts: 221
|
Posted: Sat Jan 06, 2024 10:39 pm Post subject: |
|
|
As I have mentioned in OP, I have moved to chronyd (inspired by this thread) on problematic boxes, so there is nothing to sniff. I could try to switch back to ntp-client, but with any luck it will get magically fixed there too. Also I am not too eager to incur downtime by experimenting on my boxes right now. So with nothing to debug, this thread is just guess game. I don't even know what I have expected from this, maybe just a rant . |
|
Back to top |
|
|
|