Date: Tue, 28 Nov 2017 12:44:00 -0800 From: Cy Schubert <Cy.Schubert@komquats.com> To: Andre Albsmeier <andre@fbsd.e4m.org> Cc: Cy Schubert <cy@FreeBSD.org>, svn-src-stable-11@freebsd.org Subject: Re: svn commit: r325256 - in stable/11/etc: periodic/daily rc.d Message-ID: <201711282044.vASKi0Md004634@slippy.cwsent.com> In-Reply-To: Message from Andre Albsmeier <andre@fbsd.e4m.org> of "Tue, 28 Nov 2017 14:44:49 %2B0100." <20171128134449.GA2549@voyager>
next in thread | previous in thread | raw e-mail | index | archive | help
This is a multipart MIME message. --==_Exmh_1511901748_271730 Content-Type: text/plain; charset=us-ascii In message <20171128134449.GA2549@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. --==_Exmh_1511901748_271730 Content-Type: text/plain ; name="ntpd.diff"; charset=us-ascii Content-Description: ntpd.diff Content-Disposition: attachment; filename="ntpd.diff" 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) --==_Exmh_1511901748_271730 Content-Type: text/plain; charset=us-ascii Cheers, Cy Schubert <Cy.Schubert@cschubert.com> FreeBSD UNIX: <cy@FreeBSD.org> Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. --==_Exmh_1511901748_271730--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201711282044.vASKi0Md004634>