Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
ntpd setup?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo on PPC
View previous topic :: View next topic  
Author Message
_savage
Guru
Guru


Joined: 06 Jun 2004
Posts: 308
Location: Redmond, WA

PostPosted: Tue Aug 03, 2004 2:10 am    Post subject: ntpd setup? Reply with quote

hello :) so i emerged ntpd, installed and configured it:

Code:
root@tigger ~ # cat /etc/ntp.conf
restrict default noquery notrust nomodify
restrict 127.0.0.1
restrict 172.16.0.0 mask 255.255.0.0
fudge 127.127.1.0 stratum 3
server 127.127.1.0
server 17.254.0.26 # time.apple.com
server 17.254.0.28
server 17.254.0.31
driftfile /var/lib/ntp/ntp.drift
logfile /var/log/ntp.log


however, when i run it, the system clock is not set but instead i get these log messages

Code:
 1 Aug 22:25:48 ntpd[7061]: synchronized to LOCAL(0), stratum=5
 1 Aug 22:25:48 ntpd[7061]: kernel time sync disabled 0041
 1 Aug 22:26:54 ntpd[7061]: kernel time sync disabled 0001


and they are repeated. did i forget a kernel module? according to <include/sys/timex.h> the clock was not sync'ed, right? how do i fix that? i read somewhere that this is actually an ok message, but why doesn't my system get time updated?

cheers,
jens
_________________
Jens Troeger
http://savage.light-speed.de/
Back to top
View user's profile Send private message
jdgill0
Veteran
Veteran


Joined: 25 Mar 2003
Posts: 1366
Location: Lexington, Ky -- USA

PostPosted: Tue Aug 03, 2004 2:43 am    Post subject: Reply with quote

I believe if the difference between the time server and your system is too large, ntpd will NOT adjust your clock. You can run ntpdate some_time_server to set your system clock before starting ntpd. After that you "should" be ok with ntpd. I have had on rare occasion (system being off for extended period of time) to run ntpdate to reset the clock before running ntpd again.
Back to top
View user's profile Send private message
_savage
Guru
Guru


Joined: 06 Jun 2004
Posts: 308
Location: Redmond, WA

PostPosted: Tue Aug 03, 2004 3:11 am    Post subject: Reply with quote

ah thanks. i did a

Code:
root@tigger ~ # /etc/init.d/ntpd stop
 * Stopping ntpd...                      [ ok ]
root@tigger ~ # ntpdate time.apple.com
Looking for host time.apple.com and service ntp
host found : time1.apple.com
 2 Aug 20:08:11 ntpdate[6142]: step time server 17.254.0.27 offset 3663.530878 sec


and then restarted ntpd. what puzzles me though is that the "server" entries in /etc/ntpd.conf were gone?? how come, what is overwriting that?

jens
_________________
Jens Troeger
http://savage.light-speed.de/


Last edited by _savage on Wed Aug 04, 2004 6:43 am; edited 1 time in total
Back to top
View user's profile Send private message
jdgill0
Veteran
Veteran


Joined: 25 Mar 2003
Posts: 1366
Location: Lexington, Ky -- USA

PostPosted: Tue Aug 03, 2004 3:15 am    Post subject: Reply with quote

_savage wrote:
ah thanks. i did a

Code:
root@tigger ~ # /etc/init.d/ntpd stop
 * Stopping ntpd...                                                       [ ok ]
root@tigger ~ # ntpdate time.apple.com
Looking for host time.apple.com and service ntp
host found : time1.apple.com
 2 Aug 20:08:11 ntpdate[6142]: step time server 17.254.0.27 offset 3663.530878 sec


and then restarted ntpd. what puzzles me though is that the "server" entries in /etc/ntpd.conf were gone?? how come, what is overwriting that?

jens


From my experience with ntpd, it seems ntpd will kill your /etc/ntpd.conf file if it has problems starting :( ... myself I don't know why, but I know it sure is annoying :!: ... I keep a backup of my ntpd.conf file just because of this behavior.
Back to top
View user's profile Send private message
_savage
Guru
Guru


Joined: 06 Jun 2004
Posts: 308
Location: Redmond, WA

PostPosted: Tue Aug 03, 2004 3:31 am    Post subject: Reply with quote

jdgill0 wrote:
From my experience with ntpd, it seems ntpd will kill your /etc/ntpd.conf file if it has problems starting :( ... myself I don't know why, but I know it sure is annoying :!: ... I keep a backup of my ntpd.conf file just because of this behavior.


that is one weird feature...
jens
_________________
Jens Troeger
http://savage.light-speed.de/
Back to top
View user's profile Send private message
zojas
Veteran
Veteran


Joined: 22 Apr 2002
Posts: 1138
Location: Phoenix, AZ

PostPosted: Tue Aug 03, 2004 6:41 pm    Post subject: Reply with quote

ntp is probably not killing the ntp.conf. it's probably dhcpcd.

in /etc/conf.d/net trying add the -N flag to the dhcpcd_ethx variable, that way dhcpcd will not overwrite the ntp.conf file.
_________________
http://www.desertsol.com/~kevin/ppc
Back to top
View user's profile Send private message
jdgill0
Veteran
Veteran


Joined: 25 Mar 2003
Posts: 1366
Location: Lexington, Ky -- USA

PostPosted: Tue Aug 03, 2004 7:41 pm    Post subject: Reply with quote

zojas wrote:
ntp is probably not killing the ntp.conf. it's probably dhcpcd.

in /etc/conf.d/net trying add the -N flag to the dhcpcd_ethx variable, that way dhcpcd will not overwrite the ntp.conf file.


Ahh yes, now I do recall reading this before. But even so, why does dhcpd need to overwrite /etc/ntpd.conf? This seems like dhpcd would add a vulnerability to your system by being able to overwrite a config file it does not like :!:
Back to top
View user's profile Send private message
think4urs11
Bodhisattva
Bodhisattva


Joined: 25 Jun 2003
Posts: 6659
Location: above the cloud

PostPosted: Tue Aug 03, 2004 7:48 pm    Post subject: Reply with quote

jdgill0 wrote:
...
But even so, why does dhcpd need to overwrite /etc/ntpd.conf?...


Because you can configure DHCP to give out ntp server(s) besides the obivous ip informations.
But i agree with you, it is a bit useless to have dhcpcd overwrite the ntpd.conf unless the dhcp-option for ntp is really there.
_________________
Nothing is secure / Security is always a trade-off with usability / Do not assume anything / Trust no-one, nothing / Paranoia is your friend / Think for yourself
Back to top
View user's profile Send private message
jdgill0
Veteran
Veteran


Joined: 25 Mar 2003
Posts: 1366
Location: Lexington, Ky -- USA

PostPosted: Tue Aug 03, 2004 8:47 pm    Post subject: Reply with quote

Think4UrS11 wrote:
jdgill0 wrote:
...
But even so, why does dhcpd need to overwrite /etc/ntpd.conf?...


Because you can configure DHCP to give out ntp server(s) besides the obivous ip informations.
But i agree with you, it is a bit useless to have dhcpcd overwrite the ntpd.conf unless the dhcp-option for ntp is really there.


That clears that up ... thanks for the info.
Back to top
View user's profile Send private message
_savage
Guru
Guru


Joined: 06 Jun 2004
Posts: 308
Location: Redmond, WA

PostPosted: Wed Aug 04, 2004 6:40 am    Post subject: Reply with quote

zojas wrote:
in /etc/conf.d/net trying add the -N flag to the dhcpcd_ethx variable, that way dhcpcd will not overwrite the ntp.conf file.


yep, i changed that (and nice, i changed the timeout too, which i always wanted to anyway!). so /etc/conf.d/net now contains

Code:
ifconfig_eth1=( "dhcp" )
dhcpcd_eth1="-t 10 -N"


which, so far, seems to leave the ntpd.conf file alone.

on another note, because ntpd does not sync if the system time is too out-dated (see above), i added the following to my /etc/init.d/ntpd

Code:
ebegin "Updating system time"
/usr/bin/ntpdate ${DEFAULT_TIME_SERVER}


this goes into the start() function. DEFAULT_TIME_SERVER is set to one of my time servers. works most excellent for me :-) it would be cool to read the actual config file and use the time server given there, instead of having it inside the init script.

jens
_________________
Jens Troeger
http://savage.light-speed.de/
Back to top
View user's profile Send private message
zojas
Veteran
Veteran


Joined: 22 Apr 2002
Posts: 1138
Location: Phoenix, AZ

PostPosted: Wed Aug 04, 2004 12:58 pm    Post subject: Reply with quote

that's what /etc/init.d/ntp-client is for :) just configure it in /etc/conf.d and add it to the default runlevel, it runs before ntp and sets your clock using ntpdate.
_________________
http://www.desertsol.com/~kevin/ppc
Back to top
View user's profile Send private message
_savage
Guru
Guru


Joined: 06 Jun 2004
Posts: 308
Location: Redmond, WA

PostPosted: Wed Aug 04, 2004 2:43 pm    Post subject: Reply with quote

:D thanks for the hint! i changed that... (didn't touch /etc/conf.d/ though, i just added ntp-client to the default runlevel)

btw, is there a list of available time servers somewhere? i mean, it would be nice to know where a nearby server is if i move around. i'd be silly to sync with a server somewhere far beyond...
_________________
Jens Troeger
http://savage.light-speed.de/


Last edited by _savage on Wed Aug 04, 2004 2:47 pm; edited 1 time in total
Back to top
View user's profile Send private message
zojas
Veteran
Veteran


Joined: 22 Apr 2002
Posts: 1138
Location: Phoenix, AZ

PostPosted: Wed Aug 04, 2004 2:47 pm    Post subject: Reply with quote

/etc/conf.d/ntp-client is where you tell ntpdate what servers to use. (you can list more than one)
_________________
http://www.desertsol.com/~kevin/ppc
Back to top
View user's profile Send private message
_savage
Guru
Guru


Joined: 06 Jun 2004
Posts: 308
Location: Redmond, WA

PostPosted: Wed Aug 04, 2004 2:49 pm    Post subject: Reply with quote

zojas wrote:
/etc/conf.d/ntp-client is where you tell ntpdate what servers to use. (you can list more than one)


ah thanks. and that file answers my latter question too: http://www.eecis.udel.edu/~mills/ntp/clock2a.html for example. excellent, most excellent!
_________________
Jens Troeger
http://savage.light-speed.de/
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on PPC 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