View previous topic :: View next topic |
Author |
Message |
RAPHEAD Tux's lil' helper
Joined: 20 Jun 2003 Posts: 134 Location: Germany
|
Posted: Mon Sep 02, 2013 8:51 pm Post subject: NTPD with Sys5 init is not Continuously Synchronizing Time |
|
|
Hi,
I have a fairly recent system but after 90 days uptime I noticed that there is a time drift.
I have ntpd running:
Code: | /usr/sbin/ntpd -p /var/run/ntpd.pid -u ntp:ntp |
With this config:
Code: | restrict default nomodify nopeer
restrict 127.0.0.1
|
The wiki says "Add ntpd to the default runlevel to have the time synchronized automatically"
http://wiki.gentoo.org/wiki/NTP
So I don't understand why it is not syncing.
Only after running ntp-client manually, the time got synced. |
|
Back to top |
|
|
massimo Veteran
Joined: 22 Jun 2003 Posts: 1226
|
Posted: Fri Sep 06, 2013 11:23 am Post subject: |
|
|
You have to add other NTP servers to /etc/ntp.conf. _________________ Hello 911? How are you? |
|
Back to top |
|
|
666threesixes666 Veteran
Joined: 31 May 2011 Posts: 1248 Location: 42.68n 85.41w
|
|
Back to top |
|
|
RAPHEAD Tux's lil' helper
Joined: 20 Jun 2003 Posts: 134 Location: Germany
|
Posted: Fri Sep 06, 2013 5:02 pm Post subject: |
|
|
Hi,
many thanks for your support and for putting it in the wiki!
Unfortunately, I think I have ntp-client running which Code: | rc-service ntp-client status | confirms.
But still there was a time drift in half a year by 6 minutes and only after restarting ntp-client manually again fixed it.
So I think that ntp-client is not synchronizing continuously. |
|
Back to top |
|
|
toralf Developer
Joined: 01 Feb 2004 Posts: 3925 Location: Hamburg
|
Posted: Fri Sep 06, 2013 5:17 pm Post subject: |
|
|
RAPHEAD wrote: | So I think that ntp-client is not synchronizing continuously. | Yes.
I use this config values - they do work since last century : Code: | tfoerste@n22 ~ $ grep -v -e '^$' -e '#' /etc/ntp.conf
server 0.gentoo.pool.ntp.org
server 1.gentoo.pool.ntp.org
server 2.gentoo.pool.ntp.org
server 3.gentoo.pool.ntp.org
driftfile /var/lib/ntp/ntp.drift
restrict default nomodify nopeer
restrict 127.0.0.1
|
|
|
Back to top |
|
|
666threesixes666 Veteran
Joined: 31 May 2011 Posts: 1248 Location: 42.68n 85.41w
|
Posted: Fri Sep 06, 2013 5:51 pm Post subject: |
|
|
id just run the server, and remove the client / ntpdate.... id run ntpdate pool.ntp.org once, then ntpd for the long haul.
id then /etc/conf.d/hwclock
Code: |
clock_hctosys="YES"
clock_systohc="YES"
|
&&
rc-update add hwclock boot
ive yet to wiki this. |
|
Back to top |
|
|
toralf Developer
Joined: 01 Feb 2004 Posts: 3925 Location: Hamburg
|
Posted: Fri Sep 06, 2013 6:26 pm Post subject: |
|
|
666threesixes666 wrote: | Code: |
clock_hctosys="YES"
clock_systohc="YES"
|
| The reporter mentioned a 90 day uptime period, so although this is helpful in general it is not the root cause of his problem. The root cause is the missing external time source/s, isn't it ? |
|
Back to top |
|
|
666threesixes666 Veteran
Joined: 31 May 2011 Posts: 1248 Location: 42.68n 85.41w
|
Posted: Fri Sep 06, 2013 6:48 pm Post subject: |
|
|
ntpdate should be called frequently from a cron job, or ntp-client should be restarted from a cron job frequently. or run the ntpd server and have it adjust clock rates gradually all the time. they want ntpd behavior, and to turn ntp-client / ntpdate stuff off, those are like stand alone sync right now clients. ntpd would adjust drift rates and correct the drift and sync against online atomic clocks. |
|
Back to top |
|
|
dmpogo Advocate
Joined: 02 Sep 2004 Posts: 3267 Location: Canada
|
Posted: Fri Sep 06, 2013 8:28 pm Post subject: |
|
|
toralf wrote: | 666threesixes666 wrote: | Code: |
clock_hctosys="YES"
clock_systohc="YES"
|
| The reporter mentioned a 90 day uptime period, so although this is helpful in general it is not the root cause of his problem. The root cause is the missing external time source/s, isn't it ? |
Of course, it is, it seems he does not have external time servers specified and is synchronizing just with himself.
However, one should remember that if the time mismatch is too large, ntpd will refuse to synchronize and will exit - you need to synchronize manually first. It can happen if uptime is large with synchronization off or when system clock is not synced to hardware, so on reboot you get hardware time which is off. So uptime and options above may have some relevance to the situation.
Last edited by dmpogo on Fri Sep 06, 2013 11:02 pm; edited 1 time in total |
|
Back to top |
|
|
666threesixes666 Veteran
Joined: 31 May 2011 Posts: 1248 Location: 42.68n 85.41w
|
Posted: Fri Sep 06, 2013 9:18 pm Post subject: |
|
|
ive seen other distributions run ntp-date to set local time, then hand over to ntpd. (slackware) maybe there is a method to do this, like set client to run @ boot & ntpd @ default. (or maybe both default would do this since its alphabetical?)
"it seems he does not have external time servers specified and is synchronizing just with himself. " he's syncing remotely once, and then never syncing or adjusting clock skew again. " it seems he does not have external time servers" or both. |
|
Back to top |
|
|
toralf Developer
Joined: 01 Feb 2004 Posts: 3925 Location: Hamburg
|
Posted: Fri Sep 06, 2013 9:29 pm Post subject: |
|
|
666threesixes666 wrote: | ive seen other distributions run ntp-date to set local time, then hand over to ntpd. (slackware) maybe there is a method to do this | ?
That's exactly, how it works in Gentoo - simply add ntpd and ntp-client to "default" runlevel. |
|
Back to top |
|
|
dmpogo Advocate
Joined: 02 Sep 2004 Posts: 3267 Location: Canada
|
Posted: Fri Sep 06, 2013 11:05 pm Post subject: |
|
|
666threesixes666 wrote: | ive seen other distributions run ntp-date to set local time, then hand over to ntpd. (slackware) maybe there is a method to do this, like set client to run @ boot & ntpd @ default. (or maybe both default would do this since its alphabetical?)
"it seems he does not have external time servers specified and is synchronizing just with himself. " he's syncing remotely once, and then never syncing or adjusting clock skew again. " it seems he does not have external time servers" or both. |
(or maybe both default would do this since its alphabetical?)
Yep, sure, you now openrc has things like 'after', 'need', etc. If you look at /etc/init.d/ntpd it says
Code: |
depend() {
use net dns logger
after ntp-client
}
|
so adding both ntp-client and ntpd to default will launch them in the required sequence. |
|
Back to top |
|
|
666threesixes666 Veteran
Joined: 31 May 2011 Posts: 1248 Location: 42.68n 85.41w
|
|
Back to top |
|
|
Jaglover Watchman
Joined: 29 May 2005 Posts: 8291 Location: Saint Amant, Acadiana
|
|
Back to top |
|
|
666threesixes666 Veteran
Joined: 31 May 2011 Posts: 1248 Location: 42.68n 85.41w
|
Posted: Fri Sep 06, 2013 11:21 pm Post subject: |
|
|
Jaglover wrote: | net-misc/openntpd or net-misc/ntp ? |
net-misc/openntpd should be its own wiki page, go crazy on it i don't intend to follow through past working on the net-misc/ntp.
net-misc/ntpclient & net-misc/openntpd & net-misc/ntp could make good ntp protocol sub pages. |
|
Back to top |
|
|
RAPHEAD Tux's lil' helper
Joined: 20 Jun 2003 Posts: 134 Location: Germany
|
Posted: Mon Sep 09, 2013 7:43 am Post subject: |
|
|
Hi,
I double checked with the wiki but everything is set up as documented, also the kernel settings.
I will track it and hope that it works now. |
|
Back to top |
|
|
|