From owner-freebsd-questions@freebsd.org Wed Jun 5 19:41:28 2019 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BFBDA15B73B7 for ; Wed, 5 Jun 2019 19:41:28 +0000 (UTC) (envelope-from matthias@smormegpa.no) Received: from mailrelay4-1.pub.mailoutpod1-cph3.one.com (mailrelay4-1.pub.mailoutpod1-cph3.one.com [46.30.210.185]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1FBE56A353 for ; Wed, 5 Jun 2019 19:41:26 +0000 (UTC) (envelope-from matthias@smormegpa.no) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=smormegpa.no; s=20140924; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:from; bh=qrUgBoT+n6Z08WoYOR3+164kijMT44vNREhsgfWzlCw=; b=pr64YyVIw1s/w5PzwR2IjwVJjEz9soeGk3wSjuPmrl+XRpOl+58dWLkLDW3DJvmxV92Gz5H6c+cac VayUGnS0or7nZNurAMShvAFugvyQsp5jeKZnzz1s4Je3MqDYctpqIGckMYvdKVHIXq/3/cvV1k52qm 2glqiHuuPMzphBV8= X-HalOne-Cookie: ebe034bb57914eae977e0f09e13aaa5e9bb21cef X-HalOne-ID: a1ee899c-87c7-11e9-abcc-d0431ea8bb10 Received: from phlatboks (unknown [85.166.11.66]) by mailrelay4.pub.mailoutpod1-cph3.one.com (Halon) with ESMTPSA id a1ee899c-87c7-11e9-abcc-d0431ea8bb10; Wed, 05 Jun 2019 19:25:10 +0000 (UTC) Message-ID: <58688a77362d7caad70df844d5077d0916f7f944.camel@smormegpa.no> Subject: Re: ntpd configutration -- a small suggestion from the peanut gallery From: Matthias Oestreicher To: "Ronald F. Guilmette" Cc: freebsd-questions@freebsd.org Date: Wed, 05 Jun 2019 21:25:09 +0200 In-Reply-To: <51500.1559755693@segfault.tristatelogic.com> References: <51500.1559755693@segfault.tristatelogic.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 FreeBSD GNOME Team Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 1FBE56A353 X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=pass header.d=smormegpa.no header.s=20140924 header.b=pr64YyVI X-Spamd-Result: default: False [-1.98 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[smormegpa.no:s=20140924]; NEURAL_HAM_MEDIUM(-0.59)[-0.585,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; NEURAL_HAM_LONG(-0.98)[-0.984,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[smormegpa.no]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[smormegpa.no:+]; MX_GOOD(-0.01)[cached: mx1.pub.mailpod3-cph3.one.com]; RCVD_IN_DNSWL_NONE(0.00)[185.210.30.46.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_SHORT(-0.73)[-0.728,0]; RCPT_COUNT_TWO(0.00)[2]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; IP_SCORE(0.13)[ipnet: 46.30.208.0/21(0.37), asn: 51468(0.28), country: DK(-0.02)]; ASN(0.00)[asn:51468, ipnet:46.30.208.0/21, country:DK]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Jun 2019 19:41:29 -0000 Am Mittwoch, den 05.06.2019, 10:28 -0700 schrieb Ronald F. Guilmette: > In message , > Matthias Oestreicher wrote: > > > NTP works out of the box, but does not accept big time changes unless you run it > > with > > the -g option. I think it's not ntp's fault. > > OK. Thanks. It now appears that this was indeed the issue, and I did > need the -g option. The ntpd daemon -was- dying entirely, shortly after > starting up, but now I have run it manually with the -g option and also > with the other options that it normally gets when it has been started > via "/etc/rc.d/ntpd start" and now all seems to be well. > > (Apparently, adding ntpd_sync_on_start="YES" to /etc/rc.conf is the > particular magic that should be used to cause ntpd to always be started > with the -g option, which suits me just fine. I'm not sure why this > isn't used by default, but I guess that some folks are a lot more > worried about their time getting set wrong somehow than I am.) > > Just one more small thing... The man page for ntpd says, very explicitly, > undetr the description of the -g option, that when and if ntpd finds > that the time adjustment needed is too big, it will exit *and* also > write a message (presumably explaining why it did that) to "the system > log". I am assming that for a fresh new system that has not yet been > fiddled too much, that means the message in question... which explains > why ntpd has elected to commit suicide... should appear in the > /var/log/messages file. Certainly I *am* seeing other messages from > ntpd in that file. But I am quite certainly *not* seeing any message > in that file and tagged with the name "ntpd" that mentioned either that > ntpd was electing to commit suicide *or* the reason why it might be > doing so. > > Did I just miss those ntpd death messages somehow? Sorry, I've never seen ntpd exit due to too big offset and I don't know how that would show in /var/log/messages. Anyway, even if it seems to work now, I'd check if your time is based on localtime or GMT. It's recommended to use GMT, I never use localtime personally. In your original question you said:"off by several hours" and that's usually caused by having FreeBSD configured to use localtime, while the hardware clock in the BIOS is set to GMT (or maybe the otherway around). This happend to me once, when I accidentally chose localtime during install, while I had BIOS clock set to GMT. I was totally confused and wondered where that offset came from, until I got the hint to remove /etc/wall_cmos_clock on the forums. That said, check if the file /etc/wall_cmos_clock exists and if, remove it (it's an empty file). Normally, neither the -g option nor sync_on_start should be needed, if the hardware clock in your computer's BIOS is correctly set to GMT. Doesn't hurt to use them, but if ntpd does not work without, I'd check the clock. Open www.greenwichmeantime.com on your cellphone and set your BIOS clock to what it shows under "GMT now". Then you'll normaly get no more then a few seconds off, which ntpd handles without the need to accept big changes. Hope this helps you a little bit to understand what's going on.