From owner-freebsd-questions@freebsd.org Thu Oct 20 14:31:33 2016 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 918A9C1919E for ; Thu, 20 Oct 2016 14:31:33 +0000 (UTC) (envelope-from matthew@FreeBSD.org) Received: from smtp.infracaninophile.co.uk (smtp.infracaninophile.co.uk [81.2.117.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.infracaninophile.co.uk", Issuer "infracaninophile.co.uk" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 395BF7DA for ; Thu, 20 Oct 2016 14:31:33 +0000 (UTC) (envelope-from matthew@FreeBSD.org) Received: from zero-gravitas.local (unknown [85.199.232.226]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: m.seaman@infracaninophile.co.uk) by smtp.infracaninophile.co.uk (Postfix) with ESMTPSA id 3B374EA35 for ; Thu, 20 Oct 2016 14:31:23 +0000 (UTC) Authentication-Results: smtp.infracaninophile.co.uk; dmarc=none header.from=FreeBSD.org Authentication-Results: smtp.infracaninophile.co.uk/3B374EA35; dkim=none; dkim-atps=neutral Subject: Re: 11.0 with base ntpd daily leapfile problem To: freebsd-questions@freebsd.org References: <5808D23D.5000306@gmail.com> From: Matthew Seaman Message-ID: Date: Thu, 20 Oct 2016 15:31:15 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <5808D23D.5000306@gmail.com> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="i9Sm22CSxJIXFWhfDAdja4KLmB6FHktNs" X-Spam-Status: No, score=-0.4 required=5.0 tests=BAYES_00,RDNS_NONE, SPF_SOFTFAIL autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on smtp.infracaninophile.co.uk X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Oct 2016 14:31:33 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --i9Sm22CSxJIXFWhfDAdja4KLmB6FHktNs Content-Type: multipart/mixed; boundary="9Kdt64dIdFKST8pETK1RajToPbKlee0p0"; protected-headers="v1" From: Matthew Seaman To: freebsd-questions@freebsd.org Message-ID: Subject: Re: 11.0 with base ntpd daily leapfile problem References: <5808D23D.5000306@gmail.com> In-Reply-To: <5808D23D.5000306@gmail.com> --9Kdt64dIdFKST8pETK1RajToPbKlee0p0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 2016/10/20 15:18, Ernie Luzar wrote: > Hello list; >=20 > Every morning the "ps ax" command shows these 2 tasks running. > They never change or go away until I manually kill it. >=20 >=20 > /root >ps ax > PID TT STAT TIME COMMAND > ---snip-- > 729 - Ss 0:35.63 /usr/sbin/ntpd -g -c /etc/ntp.conf -p > /var/run/ntpd. > 28509 - I 0:00.00 /bin/sh /etc/periodic/daily/480.leapfile-ntp= d > 28512 - I 0:00.00 sleep 84627 >=20 >=20 > This is the text of the script >=20 > /root >cat /etc/periodic/daily/480.leapfile-ntpd > #!/bin/sh > # > # $FreeBSD: releng/11.0/etc/periodic/daily/480.leapfile-ntpd 301102 > 2016-06-01 04:37:43Z cy $ > # >=20 > # If there is a global system configuration file, suck it in. > # > if [ -r /etc/defaults/periodic.conf ] > then > . /etc/defaults/periodic.conf > source_periodic_confs > fi >=20 > case "$daily_ntpd_leapfile_enable" in > [Yy][Ee][Ss]) > case "$daily_ntpd_avoid_congestion" in > [Yy][Ee][Ss]) > # Avoid dogpiling > (sleep $(jot -r 1 0 86400); service ntpd onefetch) & > ;; > *) > service ntpd onefetch > ;; > esac > ;; > esac >=20 > exit $rc >=20 >=20 >=20 > I think I need to file a bug report about this. > What do I have to manually change in the script to fix this problem? ntpd is the NTP daemon -- it is intended to run continually. What you're seeing is the way the script is intended to work. The 'sleep NNNNNN' is a random delay between 0s and 1 day intended to spread out the load of downloading the leapfile and avoid all those FreeBSD machines in each timezone around the world hitting the download site within seconds of each other. If you enable 'daily_ntpd_avoid_congestion' in your periodic.conf (it's enabled by default) then it may cause your daily period scripts to take hours longer to complete each day (although most of that time will be taken up by the process sleeping). Probably your best approach will be to run 'service ntpd onefetch' by hand -- once the NTP daemon has a valid leapfile it won't need to download another one until the expiry date given inside the file. Cheers, Matthew --9Kdt64dIdFKST8pETK1RajToPbKlee0p0-- --i9Sm22CSxJIXFWhfDAdja4KLmB6FHktNs Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQJ8BAEBCgBmBQJYCNU5XxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQxOUYxNTRFQ0JGMTEyRTUwNTQ0RTNGMzAw MDUxM0YxMEUwQTlFNEU3AAoJEABRPxDgqeTnuOAP/22VdNzq3p7RndpJinpxKUnz nAKoAqz60yjiholjhlL1/gqEgsRZ7OaPq5kUnfPmwrKTiKVUVLzb00z+ttfZczM1 HdKqAnLFKWp8q7oA+DDzxddYqqxp/OiF38cdysj9jwluJWSSQ4pMIuSpkrXooPf0 YcK0AwxuEfLcIQQ+rlLH1/bTt4tb4/EREFeJZt1Q0SmJJudWwx2peb+4RW8ZI82n BPIsi8ysgHDYO9voSui4PkBb9v7//kYYLPwEMtuYtee4WqAAYCwxF7JPqIr5cS0G Bk3x3P3Cc+B8/uwC5S/z0Z/tJgl6R2bpCV8BMMQMeKrPvZODhmtNVjK+IxZkWUGp lH5pncZGnepmT8c/dXaWGGuNq0d86Bw6u3JAaVQZInbD58XdoXdWXsyJBWk6HkFY dRQ/3wgQNmeK+cbWLZ+6yZi8bjwXaa4zCmRhRT5B0tlgvySOWMXAdjB68KH/N8am Vn0VIS2AR1jJ0Tn9oeXDO5dz2oK+DteQppPsSCZvSysr8zrJ3yvwCgOZqE//R3+Z sZ5vyjWR7uEdoNPAMCW61WPQfzQqBmfZ88eCjK5S6HQjVATDo8aQuedcwQ6xfQ93 jpT+KPhTmLnzRPF2HL2uUbKFu27iL36RJGo3STyPbcifd7Sob+nCjnAWcsyxsfJs AjaBrKICGauCIJk2BR5M =beBf -----END PGP SIGNATURE----- --i9Sm22CSxJIXFWhfDAdja4KLmB6FHktNs--