Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 8 May 2007 16:29:34 +0200 (CEST)
From:      Oliver Fromme <olli@lurza.secnetix.de>
To:        freebsd-stable@FreeBSD.ORG, Martin Dieringer <martin.dieringer@gmx.de>
Subject:   Re: clock problem
Message-ID:  <200705081429.l48ETYYr087578@lurza.secnetix.de>
In-Reply-To: <20070508151525.Y839@thinkpad.dieringer.dyndns.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Martin Dieringer wrote:
 > Oliver Fromme wrote:
 > > Are you sure that your /etc/ntp.conf ist correct?
 > 
 > # cat /etc/ntp.conf
 > 
 > server time.fu-berlin.de iburst maxpoll 9
 > driftfile /var/db/ntp.drift
 > logfile /var/log/ntpd

You must add "restrict" lines for every server and for
localhost, like these:

restrict time.fu-berlin.de nomodify
restrict 127.0.0.1

Other than that, the config looks good.  There's no need
to add further time servers.  Restart ntpd for the changes
to take effect (``/etc/rc.d/ntpd restart'').

 > # ntpq -p
 > No association ID's returned

That's because the default (when no "restrict" lines are
there) doesn't allow a connection at all..

 > > Make sure that you have these two lines in /etc/rc.conf:
 > > 
 > > ntpd_enable="YES"
 > > ntpd_sync_on_start="YES"
 > 
 > how can I sync on start if I have to first dialup?

ntpd does that as soon as it can reach the server for the
first time.  You don't have to worry about it.

 > I have ntpd_flags="-g" - the same?

Yes.  ntpd_sync_on_start is exactly the same.

 > and how will the clock run when not connected to the internet?

ntpd calculates the drift of the local clock.  During times
when it cannot reach the server, it corrects the local
clock using the recorded drift.

 > it should at least be somehow in a sensible range

Yes, it should, if the off-line times aren't too long.

 > now this is the machine with 2 minutes offset after 30hours uptime
 > (the other one has ntpd killed at signal 15 - some version problem I
 > think)
 > But 2 minutes is also too much

ntpd should be able to handle that without problems.

 > I can ping the server ok and internet was working at that time.
 > I have to redialup every 24h which normally works fine.

How are you redialling?  If you get a new dynamic IP
address, it might be necessary to restart ntpd.
For example, if you use ppp(8) for dial-up, you can
write a "linkup" script that performs the restart.
I.e. create a script /etc/ppp/ppp.linkup with these
lines in it:

MYADDR:
 !bg /etc/rc.d/ntpd restart    

Best regards
   Oliver

-- 
Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing b. M.
Handelsregister: Registergericht Muenchen, HRA 74606,  Geschäftsfuehrung:
secnetix Verwaltungsgesellsch. mbH, Handelsregister: Registergericht Mün-
chen, HRB 125758,  Geschäftsführer: Maik Bachmann, Olaf Erb, Ralf Gebhart

FreeBSD-Dienstleistungen, -Produkte und mehr:  http://www.secnetix.de/bsd

(On the statement print "42 monkeys" + "1 snake":)  By the way,
both perl and Python get this wrong.  Perl gives 43 and Python
gives "42 monkeys1 snake", when the answer is clearly "41 monkeys
and 1 fat snake".        -- Jim Fulton



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200705081429.l48ETYYr087578>