Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 20 Oct 2016 15:31:15 +0100
From:      Matthew Seaman <matthew@FreeBSD.org>
To:        freebsd-questions@freebsd.org
Subject:   Re: 11.0 with base ntpd daily leapfile problem
Message-ID:  <cf1146b0-029c-7754-e744-24557cf9e911@FreeBSD.org>
In-Reply-To: <5808D23D.5000306@gmail.com>
References:  <5808D23D.5000306@gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--i9Sm22CSxJIXFWhfDAdja4KLmB6FHktNs
Content-Type: multipart/mixed; boundary="9Kdt64dIdFKST8pETK1RajToPbKlee0p0";
 protected-headers="v1"
From: Matthew Seaman <matthew@FreeBSD.org>
To: freebsd-questions@freebsd.org
Message-ID: <cf1146b0-029c-7754-e744-24557cf9e911@FreeBSD.org>
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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?cf1146b0-029c-7754-e744-24557cf9e911>