From owner-freebsd-hackers@freebsd.org Tue May 23 23:08:02 2017 Return-Path: Delivered-To: freebsd-hackers@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 5287BD78C44 for ; Tue, 23 May 2017 23:08:02 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-yw0-x232.google.com (mail-yw0-x232.google.com [IPv6:2607:f8b0:4002:c05::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EF7E11157 for ; Tue, 23 May 2017 23:08:01 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-yw0-x232.google.com with SMTP id l74so81785135ywe.2 for ; Tue, 23 May 2017 16:08:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=dGmzOieipNteT0zUq09w2Gf0gwblQQjJ3gpTZMGY8oQ=; b=PXb/uL926mTtxFUuvF025FZpPqpTmLL4C8rNXWcnhn1vy6HkbFWRgBPox4V5la+ugC GMyhcjKJ8KxkEwi4s39rnqOA7/eNAyQoTmidJrHlOO6/k6T0ZNH7PXgbzNFhUPY6wc8I QEDO2E0/+8xwEFz+jkQqGIGHTFVfYuwOMGZXYil12cwIj7LYcJ2hlwFWF+a4Z3fbHEZU Vc7zJ8rlU2hpR7u76lFDG6sJAAZ08XpmEEoTiI2wpiZDGD2dHzE7+miniO2q4eSEibJl LhLeHx6P+Qv1LwKJKydhOvV5+EfjosW9D6F0o8RBkm9lwto1tJrGnJv1NWEgiuDsEr7f k4FQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=dGmzOieipNteT0zUq09w2Gf0gwblQQjJ3gpTZMGY8oQ=; b=Y24qzxpdYxNhBXShPAjfzr/SSpYvs7RM7H0H3yr3CG1mbPIja6eWskMxTYOMu4OqH8 kd+1htluiSG/fJiznoYlVswqaxbjv2K6bdoR/e+sD851YU4+MvfI0IBSL2qaMnwszf72 pKiF8gcKj/7UiUgOROjDiUDvIJjfFUphdeXIb2zzT0tUYkDBy9I/eqNcQffBMt/EjpXH xVUS8WS/TPIdiOEX7+ykkgDDqbdvBvH2G6AWCnEWMIhNQA1w3H/Upk2jy8U+cvkjBUml 0J99Q4SFTLfReriWJwOP4ZCbdU77zr1/Cazym+WKTEGauXXJvAnhFM6j0Ob1ZlJIKyQ8 y19Q== X-Gm-Message-State: AODbwcB7JkFiVRDOVfuiLR9WYpeRMGTL8nkeXUhUPWUxF07MMWj+SWiX U44ujgUq00LEWAgOtmuB5CN4BpY37Q== X-Received: by 10.13.212.68 with SMTP id w65mr4216223ywd.279.1495580881097; Tue, 23 May 2017 16:08:01 -0700 (PDT) MIME-Version: 1.0 Sender: asomers@gmail.com Received: by 10.13.206.199 with HTTP; Tue, 23 May 2017 16:08:00 -0700 (PDT) In-Reply-To: <20170523233057.59cd2393@gumby.homeunix.com> References: <20170522125307.76c9de6d@gumby.homeunix.com> <1104C7A7-5893-4602-9E34-5C212D987DAE@webweaving.org> <20170522143102.70035d8d@gumby.homeunix.com> <20170523233057.59cd2393@gumby.homeunix.com> From: Alan Somers Date: Tue, 23 May 2017 17:08:00 -0600 X-Google-Sender-Auth: rnsXCUR7gFuhUXj7f5JD5LsGRsU Message-ID: Subject: Re: anti-dog-piling and ntpd leap files To: RW Cc: "freebsd-hackers@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 May 2017 23:08:02 -0000 On Tue, May 23, 2017 at 4:30 PM, RW via freebsd-hackers wrote: > On Mon, 22 May 2017 08:09:54 -0600 > Alan Somers wrote: > >> On Mon, May 22, 2017 at 7:31 AM, RW via freebsd-hackers >> wrote: > >> > That doesn't sound like a good idea. If they aren't backgrounded >> > they'll block the rest of periodic daily for up to an hour. Not >> > much of a problem on a server, but it would be when periodic is run >> > from anacron at boot time. >> >> Actually, there are already many periodic scripts from ports that >> include foreground sleeps, mostly notably 410.pkg-audit. > > I didn't know that and I think there is a POLA violation there because > if you run "time periodic daily" from a terminal there is no warning > that delays are being skipped. This happens in the new version too. I don't see this as a problem, because when you run "periodic daily" from the terminal there is no need for any sleeping. The sleeps only matter when periodic is run by cron at a predictable time. And the periodic mechanism is only used for batch-like scripts that shouldn't care about the precise time at which they run. > >> Do those >> cause problems for anacron? I wouldn't think so, because anacron >> knows to restart a job that didn't complete the last time it was run. > > It's more about knowing when they run. I have some local scripts that > aren't entirely atomic, nothing catastrophic would happen if they were > interrupted, but I'd rather they completed. I've been avoiding > shutting down during what I thought was a very narrow window, but > turns out to be 75 minutes wider than I thought. > > Another thing is that periodic tasks can be I/O and CPU intensive and > some people may be good reason to get them out of the way at boot time, > rather than have them randomly kick-in. Like I said, the sleeps are only useful when periodic is run at a predictable time, which is not the case when you run anacron at boot. It would be reasonable to disable sleeping in that case, just like when running from the terminal. Can you suggest how? -Alan