svn commit: r325256 - in stable/11/etc: periodic/daily rc.d
Cy Schubert
Cy.Schubert at komquats.com
Tue Nov 28 20:44:30 UTC 2017
In message <20171128134449.GA2549 at voyager>, Andre Albsmeier writes:
> On Wed, 01-Nov-2017 at 01:03:44 +0000, Cy Schubert wrote:
> > Author: cy
> > Date: Wed Nov 1 01:03:44 2017
> > New Revision: 325256
> > URL: https://svnweb.freebsd.org/changeset/base/325256
> >
> > Log:
> > MFC r324681, r324738
> >
> > Anticongestion refinements for ntpd rc script. This checks if ntp
> > leapfile needs fetching before entering into the anticongestion sleep.
>
> I wonder if this will ever actually fetch leapfiles ;-)
>
> When ntpd_fetch_leapfile() is called, $ntp_tmp_leapfile will be
> empty as it was declared local in ntpd_needfetch_leapfile() resulting in:
>
> usage: fetch [-146AadFlMmnPpqRrsUv] [-B bytes] [--bind-address=host]
> [--ca-cert=file] [--ca-path=dir] [--cert=file] [--crl=file]
> [-i file] [--key=file] [-N file] [--no-passive] [--no-proxy=list]
> ...
>
> since the argument to fetch's -o is missing... Either we duplicate
>
> ntp_tmp_leapfile="/var/run/ntpd.leap-seconds.list"
>
> in ntpd_fetch_leapfile() or remove it from the local list in
> ntpd_needfetch_leapfile() (which is hacky as this will require
> ntpd_needfetch_leapfile() being called before each ntpd_fetch_leapfile())
> or we simply put
>
> ntp_tmp_leapfile="/var/run/ntpd.leap-seconds.list"
>
> on top of the script and remove other assignments and local defs...
The correct thing is to make $ntp_tmp_leapfile global.
There's been a fair bit of churn in this file due to the controversial
anticongestion. This was missed.
-------------- next part --------------
Index: etc/rc.d/ntpd
===================================================================
--- etc/rc.d/ntpd (revision 326308)
+++ etc/rc.d/ntpd (working copy)
@@ -19,6 +19,7 @@
fetch_cmd="ntpd_fetch_leapfile"
needfetch_cmd="ntpd_needfetch_leapfile"
start_precmd="ntpd_precmd"
+ntp_tmp_leapfile="/var/run/ntpd.leap-seconds.list"
load_rc_config $name
@@ -92,7 +93,7 @@
}
ntpd_needfetch_leapfile() {
- local ntp_tmp_leapfile rc verbose
+ local rc verbose
if checkyesno ntp_leapfile_fetch_verbose; then
verbose=echo
@@ -100,8 +101,6 @@
verbose=:
fi
- ntp_tmp_leapfile="/var/run/ntpd.leap-seconds.list"
-
ntp_ver_no_src=$(get_ntp_leapfile_ver $ntp_src_leapfile)
ntp_expiry_src=$(get_ntp_leapfile_expiry $ntp_src_leapfile)
ntp_ver_no_db=$(get_ntp_leapfile_ver $ntp_db_leapfile)
-------------- next part --------------
Cheers,
Cy Schubert <Cy.Schubert at cschubert.com>
FreeBSD UNIX: <cy at FreeBSD.org> Web: http://www.FreeBSD.org
The need of the many outweighs the greed of the few.
More information about the svn-src-stable-11
mailing list