-2

I am trying to configure an NTP server in a local network that doesn't has access to internet (I need all the machines to have the same time even if wrong) .

I have configured the /etc/ntp.conf files for both clients and servers. On the system startup I run ntpd -qgx to sync the time at startup to make the sync faster and then I run ntpd to continue syncing.

However it is sometimes successfully being synced while a other times it gives me :

select() returned -1: Interrupted system call

select() returned -1: Interrupted system call

1 Jan 00:02:56 ntpd[2599]: ntpd: no servers found

I really tried to get a pattern to understand when it fails... but no success for me it is totally random.

When I tried to work with google's NTP server it looked good and indeed synced each time

Does any one has faced such issue? any ideas?

my ntp.conf files:

server :

#Use the local clock
server 127.127.1.0 
fudge  127.127.1.0 stratum 0

driftfile /var/lib/ntp/drift
broadcastdelay 0.008

# Give localhost full access rights
restrict 127.0.0.1

# Give machines on our network access to query us
restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap

client:

#Point to our network's master time server
server 192.168.1.102

#restrict default ignore
restrict 127.0.0.1
restrict 192.168.1.102  mask 255.255.255.255 nomodify notrap noquery

tos orphan 16

driftfile /var/lib/ntp/drift
DimaD
  • 69
  • 1
  • 4

1 Answers1

0

Not sure about your interrupted system call, but here are a few notes about your configs, compared to your stated goals:

  • It looks like you're trying to configure your server to have no other refclocks or peers at all. This is almost certainly not going to get you time of any reasonable quality. At the very least, you'll want to either A) temporarily run your candidate server against a known well-synchronized clock for a few days to calibrate, or B) get a cheap GPS to attach to the system to use as a refclock. And if your local network is of any significant size, you'll probably want a few internal servers, not just a single one (and to detect when one clock has gone wrong, you might want a few even for a small network).

  • You almost certainly don't need broadcastdelay. Broadcast won't work without other configuration that's missing from your configs. And while I haven't worked with broadcast a lot, I haven't seen much support for it in clients in the wild. You're probably better off just using traditional client/server/peer NTP.

  • Stratum 16 is reserved for unsynchronized clocks. If you pick a lower stratum for your tos orphan config - something like tos orphan 6 or something - that might help. Otherwise, you won't get the orphan behavior you're looking for.

(And a side note about your other testing: it's not recommended to use Google's servers with ntpd, because they use leap smearing. Using peers from the NTP Pool Project is probably better for your use case. Though it also won't matter much either way unless it's on a leap-second day (last day of June or December, but only some years).)

Royce Williams
  • 1,487
  • 15
  • 24