Serve NTP but only after Linux Syncs Itself

Searinox

New Member
Joined
Feb 12, 2023
Messages
1
Reaction score
0
Credits
18
I have a Debian Linux setup on a Raspberry Pi. In addition to DNS - which I've already set up - I would like to make the device be an NTP server as well. I already know I have to install the "ntp" package in order to set up a server.

The problem is that the device has no RTC and so I do not want it serving NTP until it has synced its own clock at least once since booting.

This is particularly relevant since the device will also be serving as the router's NTP server, so when the power goes out and comes back on, if the RPI device finishes booting up before the router establishes an Internet connection, it will query the RPI for the time before it has had a chance to sync on the Internet, and after it has done so it will assume it has the correct time until the next sync interval.

But if the RPI could hold up until it's managed to sync its own clock, the router will keep trying to get the time from it until the RPI time synching has occurred, then receive the correct time.

What's the proper way to achieve this?
 

Staff online


Top