Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
ntp-client - why does it work?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
krotuss
Apprentice
Apprentice


Joined: 01 Aug 2008
Posts: 221

PostPosted: Fri Jan 05, 2024 10:37 pm    Post subject: ntp-client - why does it work? Reply with quote

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
View user's profile Send private message
szatox
Advocate
Advocate


Joined: 27 Aug 2013
Posts: 3154

PostPosted: Sat Jan 06, 2024 12:56 am    Post subject: Reply with quote

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
View user's profile Send private message
krotuss
Apprentice
Apprentice


Joined: 01 Aug 2008
Posts: 221

PostPosted: Sat Jan 06, 2024 6:32 pm    Post subject: Reply with quote

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
View user's profile Send private message
szatox
Advocate
Advocate


Joined: 27 Aug 2013
Posts: 3154

PostPosted: Sat Jan 06, 2024 10:08 pm    Post subject: Reply with quote

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
View user's profile Send private message
krotuss
Apprentice
Apprentice


Joined: 01 Aug 2008
Posts: 221

PostPosted: Sat Jan 06, 2024 10:39 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum