From owner-freebsd-pkg@freebsd.org Tue Feb 14 11:42:28 2017 Return-Path: Delivered-To: freebsd-pkg@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 42D2BCDFA4D for ; Tue, 14 Feb 2017 11:42:28 +0000 (UTC) (envelope-from Ephaeton@gmx.net) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id 24A3317C0 for ; Tue, 14 Feb 2017 11:42:28 +0000 (UTC) (envelope-from Ephaeton@gmx.net) Received: by mailman.ysv.freebsd.org (Postfix) id 23E01CDFA4C; Tue, 14 Feb 2017 11:42:28 +0000 (UTC) Delivered-To: pkg@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 21BDECDFA4B for ; Tue, 14 Feb 2017 11:42:28 +0000 (UTC) (envelope-from Ephaeton@gmx.net) Received: from mout.gmx.net (mout.gmx.net [212.227.15.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "mout.gmx.net", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 72B8717B9; Tue, 14 Feb 2017 11:42:26 +0000 (UTC) (envelope-from Ephaeton@gmx.net) Received: from hephaistos.local ([79.208.142.144]) by mail.gmx.com (mrgmx002 [212.227.17.190]) with ESMTPSA (Nemesis) id 0MQzIE-1cp2f53Bcc-00UMuC; Tue, 14 Feb 2017 12:36:45 +0100 Received: by hephaistos.local (Postfix, from userid 1000) id C6E59297CDF6; Tue, 14 Feb 2017 12:36:43 +0100 (CET) Date: Tue, 14 Feb 2017 12:36:43 +0100 From: "Martin S. Weber" To: Cy Schubert Cc: Alan Somers , scrappy@freebsd.org, Brian Somers , freebsd-bugzilla@ayaken.net, Cy Schubert , pkg@freebsd.org, Dag-Erling =?iso-8859-1?Q?Sm=F8rgrav?= Subject: Re: Bug 217055 - Consolidate random sleeps in periodic scripts Message-ID: <20170214113643.GA3593@hephaistos.local> References: <201702140647.v1E6lVd8078946@slippy.cwsent.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201702140647.v1E6lVd8078946@slippy.cwsent.com> User-Agent: Mutt/1.7.2 (2016-11-26) X-Provags-ID: V03:K0:ZReiGkskeueeCn9AHiOXG0W3v0I/AiKH+VaWh1zK9cFp2lPfXQD bHuEcFLVIbasw2HOOe1EX+x5L7VwZPQIYKv7z6UIBAo1kNPqnZ64Ga7lqIVc531ISuXtKPn Z04rpxjIeyopLra9wx7jB7e6eVVLXl40auT2Wrzuu47d6H2wd6ZCs6bsPFupiU940c0y/5P I6cUdp3NxPJz9qsKOpOVQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:UmF/bZAFpLY=:de+8SJjuqDqANetJrCvvif Y2bZ/08vGxyq69aWCUUuuj1pHcYDBFNP5dryvh6PuC4A1CTqhgTV1zDj9/GjLAFlKlfmKESyA xzLENx8OLTiNMPEKQgkRPy0Eh9hI18JqX3ILnR5tDkrf+0/lm3fL3iaZTiikuheJKq6kAAXul tTDYxGQO8rT8+5A14aP1QjPNSBT4RgqQn4GoNrWSP/PdlL//d5h4yNLVOFHy6qMQXE9xMbPgr upMJneV3LuwmqOEeKjJeXg7elgT0yW4khuveMuzljOGUUyWP5Vag2IcAevlCMJvPv46tJCXV/ bVZ27daXWn2fGmR54BvHlo+iIuB+FmXOnlYnG0vYTmvVVKaQ60bhATaP8oH1YxBw2L/a+44VI JAe3HC7vyxPc9+CefW2uYL8KbNFsEouj/BSkZ5k0DSVpD7LeutDwT4qY+gLnehSNM424XdcGB cP1Cm93MfXUL1Ar1XI6VDliJB7zdALvGtMcW8Q7cI2NM4itXyYp8S5K1qbi7wmRRybbBFFZ6J 39awBwsDqMJY37T3TsunBExLYDyFMUCCyfz2PEb2smXgE736pL1bFD7BkwCUxaD4eAcuPh+9s 4avnv9d8B3EAAG+p8hyMv/myN2b+8TGALNOBkrG4EUnC/Wy0X6xF8obiX3olOzlb5ZNhMtFLM 0WrquMrsEjjS4gz8sZhGctiHVgMjwZcuJLZpClxBkSOqsRv0CdP6sSDvuPQEQXsBPB9hBhf2l 7Y2VRPZh7gBc9hnnzUSu+gHsaFu2ANiUUS6wt6cJJgMLvz/tqwtbaI9Xb5k= X-BeenThere: freebsd-pkg@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Binary package management and package tools discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Feb 2017 11:42:28 -0000 On 2017-02-13 22:47:31, Cy Schubert wrote: (...) > Hi Alan, > > Looking at ntp, it backgrounds itself: > > (sleep $(jot -r 1 0 3600); service ntpd onefetch) & > > To facilitate debugging, I can commit the following, if you don't mind. > > Index: periodic/daily/480.leapfile-ntpd > =================================================================== > --- periodic/daily/480.leapfile-ntpd (revision 313710) > +++ periodic/daily/480.leapfile-ntpd (working copy) > @@ -13,6 +13,7 @@ > > case "$daily_ntpd_leapfile_enable" in > [Yy][Ee][Ss]) > + tty >/dev/null 2>&1 && daily_ntpd_avoid_congestion=NO > case "$daily_ntpd_avoid_congestion" in > [Yy][Ee][Ss]) > # Avoid dogpiling You are aware that these files are invoked with < /dev/null and > file 2>&1 ? Problem with sleeping from periodic from the command line is that these extra I/O indirections make it impossible from the script file itself to determine whether or not the parent process is running from a tty or not. Cf. /usr/sbin/periodic:118 For the purpose of "my" PR, your fix is useless. An environment variable could be set that stored the fact whether or not invoker is on a TTY, and this again be checked from within the periodic scripts themselves to determine whether or not we should sleep. Btw, I hate systemd & dbus, but the discussion so far really looks like the vanilla argument "pro" SOA-style module startup :( Regards, -Martin