From owner-freebsd-stable@FreeBSD.ORG Tue May 8 14:29:41 2007 Return-Path: X-Original-To: freebsd-stable@FreeBSD.ORG Delivered-To: freebsd-stable@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7D60616A400 for ; Tue, 8 May 2007 14:29:41 +0000 (UTC) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (lurza.secnetix.de [83.120.8.8]) by mx1.freebsd.org (Postfix) with ESMTP id EDB7B13C458 for ; Tue, 8 May 2007 14:29:40 +0000 (UTC) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (obmtuh@localhost [127.0.0.1]) by lurza.secnetix.de (8.13.4/8.13.4) with ESMTP id l48ETY84087579; Tue, 8 May 2007 16:29:39 +0200 (CEST) (envelope-from oliver.fromme@secnetix.de) Received: (from olli@localhost) by lurza.secnetix.de (8.13.4/8.13.1/Submit) id l48ETYYr087578; Tue, 8 May 2007 16:29:34 +0200 (CEST) (envelope-from olli) Date: Tue, 8 May 2007 16:29:34 +0200 (CEST) Message-Id: <200705081429.l48ETYYr087578@lurza.secnetix.de> From: Oliver Fromme To: freebsd-stable@FreeBSD.ORG, Martin Dieringer In-Reply-To: <20070508151525.Y839@thinkpad.dieringer.dyndns.org> X-Newsgroups: list.freebsd-stable User-Agent: tin/1.8.2-20060425 ("Shillay") (UNIX) (FreeBSD/4.11-STABLE (i386)) MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.1.2 (lurza.secnetix.de [127.0.0.1]); Tue, 08 May 2007 16:29:39 +0200 (CEST) Cc: Subject: Re: clock problem X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: freebsd-stable@FreeBSD.ORG, Martin Dieringer List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 May 2007 14:29:41 -0000 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