Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 3 Dec 2023 07:43:12 -0700
From:      Warner Losh <imp@bsdimp.com>
To:        Mike Karels <mike@karels.net>
Cc:        Xin LI <delphij@freebsd.org>, src-committers <src-committers@freebsd.org>,  "<dev-commits-src-all@freebsd.org>" <dev-commits-src-all@freebsd.org>,  "<dev-commits-src-main@freebsd.org>" <dev-commits-src-main@freebsd.org>
Subject:   Re: git: 3b3195f6767b - main - periodic/daily/480.leapfile-ntpd: only attempt to refresh leap-seconds.list when ntpd is enabled.
Message-ID:  <CANCZdfooOGv06cJFgOZRMOvSfiHx2XyZQbPfPFQSRs%2B2PAHBWQ@mail.gmail.com>
In-Reply-To: <56101076-F237-4B1E-B6E0-A08921370B75@karels.net>
References:  <202312030701.3B371MA6049553@gitrepo.freebsd.org> <56101076-F237-4B1E-B6E0-A08921370B75@karels.net>

next in thread | previous in thread | raw e-mail | index | archive | help
--0000000000000047eb060b9c068e
Content-Type: text/plain; charset="UTF-8"

On Sun, Dec 3, 2023, 6:44 AM Mike Karels <mike@karels.net> wrote:

> On 3 Dec 2023, at 1:01, Xin LI wrote:
>
> > The branch main has been updated by delphij:
> >
> > URL:
> https://cgit.FreeBSD.org/src/commit/?id=3b3195f6767b39eb33b3523134ef988931c9c86d
> >
> > commit 3b3195f6767b39eb33b3523134ef988931c9c86d
> > Author:     Xin LI <delphij@FreeBSD.org>
> > AuthorDate: 2023-12-03 07:00:32 +0000
> > Commit:     Xin LI <delphij@FreeBSD.org>
> > CommitDate: 2023-12-03 07:00:32 +0000
> >
> >     periodic/daily/480.leapfile-ntpd: only attempt to refresh
> leap-seconds.list
> >     when ntpd is enabled.
> >
> >     The leap-seconds.list is used exclusively by ntpd, therefore, do not
> bother
> >     to perform the fetch when ntpd is not enabled.
>
> Wouldn't we want an up-to-date leapsecond file for ntpdate as well?  The
> daily
> script can't know if ntpdate is being used.  Also, it seems wrong to ignore
> daily_ntpd_leapfile_enable if ntpd is not enabled.
>

 No. It doesn't need it to do the time exchange. Nor will it be steering a
local clock, so it can't insert one Iin real time. Nor is it serving time
to others that need to know. And even it today were a leap second day, the
remote server would tell it a second is pending.

The file is only used as a backup for ntpd turning on its leap indicator on
the day of the leap second.

Warner

                Mike
>
> >     PR:             conf/275419
> >     Reviewed by:    cy, michaelo, imp
> >     MFC after:      3 days
> >     Differential Revision: https://reviews.freebsd.org/D42875
> > ---
> >  usr.sbin/periodic/etc/daily/480.leapfile-ntpd | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/usr.sbin/periodic/etc/daily/480.leapfile-ntpd
> b/usr.sbin/periodic/etc/daily/480.leapfile-ntpd
> > index 17db53e625f8..c7de845ea87d 100755
> > --- a/usr.sbin/periodic/etc/daily/480.leapfile-ntpd
> > +++ b/usr.sbin/periodic/etc/daily/480.leapfile-ntpd
> > @@ -12,9 +12,9 @@ fi
> >
> >  case "$daily_ntpd_leapfile_enable" in
> >      [Yy][Ee][Ss])
> > -     if service ntpd oneneedfetch; then
> > +     if service ntpd enabled && service ntpd needfetch; then
> >           anticongestion
> > -         service ntpd onefetch
> > +         service ntpd fetch
> >       fi
> >       ;;
> >  esac
>

--0000000000000047eb060b9c068e
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"auto"><div><br><br><div class=3D"gmail_quote"><div dir=3D"ltr" =
class=3D"gmail_attr">On Sun, Dec 3, 2023, 6:44 AM Mike Karels &lt;<a href=
=3D"mailto:mike@karels.net">mike@karels.net</a>&gt; wrote:<br></div><blockq=
uote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc =
solid;padding-left:1ex">On 3 Dec 2023, at 1:01, Xin LI wrote:<br>
<br>
&gt; The branch main has been updated by delphij:<br>
&gt;<br>
&gt; URL: <a href=3D"https://cgit.FreeBSD.org/src/commit/?id=3D3b3195f6767b=
39eb33b3523134ef988931c9c86d" rel=3D"noreferrer noreferrer" target=3D"_blan=
k">https://cgit.FreeBSD.org/src/commit/?id=3D3b3195f6767b39eb33b3523134ef98=
8931c9c86d</a><br>
&gt;<br>
&gt; commit 3b3195f6767b39eb33b3523134ef988931c9c86d<br>
&gt; Author:=C2=A0 =C2=A0 =C2=A0Xin LI &lt;delphij@FreeBSD.org&gt;<br>
&gt; AuthorDate: 2023-12-03 07:00:32 +0000<br>
&gt; Commit:=C2=A0 =C2=A0 =C2=A0Xin LI &lt;delphij@FreeBSD.org&gt;<br>
&gt; CommitDate: 2023-12-03 07:00:32 +0000<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0periodic/daily/480.leapfile-ntpd: only attempt to r=
efresh leap-seconds.list<br>
&gt;=C2=A0 =C2=A0 =C2=A0when ntpd is enabled.<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0The leap-seconds.list is used exclusively by ntpd, =
therefore, do not bother<br>
&gt;=C2=A0 =C2=A0 =C2=A0to perform the fetch when ntpd is not enabled.<br>
<br>
Wouldn&#39;t we want an up-to-date leapsecond file for ntpdate as well?=C2=
=A0 The daily<br>
script can&#39;t know if ntpdate is being used.=C2=A0 Also, it seems wrong =
to ignore<br>
daily_ntpd_leapfile_enable if ntpd is not enabled.<br></blockquote></div></=
div><div dir=3D"auto"><br></div><div dir=3D"auto">=C2=A0No. It doesn&#39;t =
need it to do the time exchange. Nor will it be steering a local clock, so =
it can&#39;t insert one Iin real time. Nor is it serving time to others tha=
t need to know. And even it today were a leap second day, the remote server=
 would tell it a second is pending.</div><div dir=3D"auto"><br></div><div d=
ir=3D"auto">The file is only used as a backup for ntpd turning on its leap =
indicator on the day of the leap second.=C2=A0</div><div dir=3D"auto"><br><=
/div><div dir=3D"auto">Warner</div><div dir=3D"auto"><br></div><div dir=3D"=
auto"><div class=3D"gmail_quote"><blockquote class=3D"gmail_quote" style=3D=
"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Mike<br>
<br>
&gt;=C2=A0 =C2=A0 =C2=A0PR:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
conf/275419<br>
&gt;=C2=A0 =C2=A0 =C2=A0Reviewed by:=C2=A0 =C2=A0 cy, michaelo, imp<br>
&gt;=C2=A0 =C2=A0 =C2=A0MFC after:=C2=A0 =C2=A0 =C2=A0 3 days<br>
&gt;=C2=A0 =C2=A0 =C2=A0Differential Revision: <a href=3D"https://reviews.f=
reebsd.org/D42875" rel=3D"noreferrer noreferrer" target=3D"_blank">https://=
reviews.freebsd.org/D42875</a><br>
&gt; ---<br>
&gt;=C2=A0 usr.sbin/periodic/etc/daily/480.leapfile-ntpd | 4 ++--<br>
&gt;=C2=A0 1 file changed, 2 insertions(+), 2 deletions(-)<br>
&gt;<br>
&gt; diff --git a/usr.sbin/periodic/etc/daily/480.leapfile-ntpd b/usr.sbin/=
periodic/etc/daily/480.leapfile-ntpd<br>
&gt; index 17db53e625f8..c7de845ea87d 100755<br>
&gt; --- a/usr.sbin/periodic/etc/daily/480.leapfile-ntpd<br>
&gt; +++ b/usr.sbin/periodic/etc/daily/480.leapfile-ntpd<br>
&gt; @@ -12,9 +12,9 @@ fi<br>
&gt;<br>
&gt;=C2=A0 case &quot;$daily_ntpd_leapfile_enable&quot; in<br>
&gt;=C2=A0 =C2=A0 =C2=A0 [Yy][Ee][Ss])<br>
&gt; -=C2=A0 =C2=A0 =C2=A0if service ntpd oneneedfetch; then<br>
&gt; +=C2=A0 =C2=A0 =C2=A0if service ntpd enabled &amp;&amp; service ntpd n=
eedfetch; then<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0anticongestion<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0service ntpd onefetch<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0service ntpd fetch<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0fi<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0;;<br>
&gt;=C2=A0 esac<br>
</blockquote></div></div></div>

--0000000000000047eb060b9c068e--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANCZdfooOGv06cJFgOZRMOvSfiHx2XyZQbPfPFQSRs%2B2PAHBWQ>