From owner-svn-src-stable-11@freebsd.org Tue Nov 28 13:49:41 2017 Return-Path: Delivered-To: svn-src-stable-11@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 64EDAE57317 for ; Tue, 28 Nov 2017 13:49:41 +0000 (UTC) (envelope-from andre@fbsd.e4m.org) Received: from mail.g66.org (mail.g66.org [85.10.206.112]) by mx1.freebsd.org (Postfix) with ESMTP id 11B65657A4; Tue, 28 Nov 2017 13:49:40 +0000 (UTC) (envelope-from andre@fbsd.e4m.org) Received: from x4e35e907.dyn.telefonica.de (x4e35e907.dyn.telefonica.de [78.53.233.7]) (authenticated bits=128) by mail.g66.org (8.15.2/8.15.2) with ESMTPA id vASDinu3051685; Tue, 28 Nov 2017 14:44:50 +0100 (CET) (envelope-from andre@fbsd.e4m.org) Received: from stationary.client ([192.168.128.2]) by gate.local (8.15.2/8.15.2) with ESMTP id vASDinDt008231; Tue, 28 Nov 2017 14:44:49 +0100 (CET) (envelope-from andre@fbsd.e4m.org) Received: from submit.client ([127.0.0.1]) by voyager.local (8.15.2/8.15.2) with ESMTP id vASDinI3002638; Tue, 28 Nov 2017 14:44:49 +0100 (CET) (envelope-from andre@fbsd.e4m.org) Received: (from user@localhost) by voyager.local (8.15.2/8.15.2/Submit) id vASDin6w002637; Tue, 28 Nov 2017 14:44:49 +0100 (CET) (envelope-from andre@fbsd.e4m.org) Date: Tue, 28 Nov 2017 14:44:49 +0100 From: Andre Albsmeier To: Cy Schubert Cc: svn-src-stable-11@freebsd.org, andre@fbsd.e4m.org Subject: Re: svn commit: r325256 - in stable/11/etc: periodic/daily rc.d Message-ID: <20171128134449.GA2549@voyager> References: <201711010103.vA113iPh014257@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201711010103.vA113iPh014257@repo.freebsd.org> User-Agent: Mutt/1.7.2 (2016-11-26) X-Virus-Scanned: clamav-milter 0.99.2 at colo X-Virus-Status: Clean X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Nov 2017 13:49:41 -0000 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... -Andre > > Unfortunately some ports still use their own sleeps so, this commit > doesn't address the complete problem which is compounded by every > port that uses its own anticongestion mechanism. > > Discussed with: asomers, feld > > Modified: > stable/11/etc/periodic/daily/480.leapfile-ntpd > stable/11/etc/rc.d/ntpd > Directory Properties: > stable/11/ (props changed) > > Modified: stable/11/etc/periodic/daily/480.leapfile-ntpd > ============================================================================== > --- stable/11/etc/periodic/daily/480.leapfile-ntpd Wed Nov 1 00:46:48 2017 (r325255) > +++ stable/11/etc/periodic/daily/480.leapfile-ntpd Wed Nov 1 01:03:44 2017 (r325256) > @@ -13,8 +13,10 @@ fi > > case "$daily_ntpd_leapfile_enable" in > [Yy][Ee][Ss]) > - anticongestion > - service ntpd onefetch > + if service ntpd oneneedfetch; then > + anticongestion > + service ntpd onefetch > + fi > ;; > esac > > > Modified: stable/11/etc/rc.d/ntpd > ============================================================================== > --- stable/11/etc/rc.d/ntpd Wed Nov 1 00:46:48 2017 (r325255) > +++ stable/11/etc/rc.d/ntpd Wed Nov 1 01:03:44 2017 (r325256) > @@ -15,8 +15,9 @@ desc="Network Time Protocol daemon" > rcvar="ntpd_enable" > command="/usr/sbin/${name}" > pidfile="/var/run/${name}.pid" > -extra_commands="fetch" > +extra_commands="fetch needfetch" > fetch_cmd="ntpd_fetch_leapfile" > +needfetch_cmd="ntpd_needfetch_leapfile" > start_precmd="ntpd_precmd" > > load_rc_config $name > @@ -90,7 +91,7 @@ ntpd_init_leapfile() { > fi > } > > -ntpd_fetch_leapfile() { > +ntpd_needfetch_leapfile() { > local ntp_tmp_leapfile rc verbose > > if checkyesno ntp_leapfile_fetch_verbose; then > @@ -122,6 +123,21 @@ ntpd_fetch_leapfile() { > ntp_leap_fetch_date=$((ntp_leap_expiry-ntp_leapfile_expiry_seconds)) > if [ $(current_ntp_ts) -ge $ntp_leap_fetch_date ]; then > $verbose Within ntp leapfile expiry limit, initiating fetch > + # Return code 0: ntp leapfile fetch needed > + return 0 > + fi > + # Return code 1: ntp leapfile fetch not needed > + return 1 > +} > + > +ntpd_fetch_leapfile() { > + if checkyesno ntp_leapfile_fetch_verbose; then > + verbose=echo > + else > + verbose=: > + fi > + > + if ntpd_needfetch_leapfile ; then > for url in $ntp_leapfile_sources ; do > $verbose fetching $url > fetch $ntp_leapfile_fetch_opts -o $ntp_tmp_leapfile $url && break > _______________________________________________ > svn-src-stable-11@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-stable-11 > To unsubscribe, send any mail to "svn-src-stable-11-unsubscribe@freebsd.org"