Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 23 May 2017 17:08:00 -0600
From:      Alan Somers <asomers@freebsd.org>
To:        RW <rwmaillists@googlemail.com>
Cc:        "freebsd-hackers@freebsd.org" <freebsd-hackers@freebsd.org>
Subject:   Re: anti-dog-piling and ntpd leap files
Message-ID:  <CAOtMX2g=YuSUYTXWvuuKR1KJ8eDhQsHVQ12juC7ckfRUCRb7zQ@mail.gmail.com>
In-Reply-To: <20170523233057.59cd2393@gumby.homeunix.com>
References:  <D8A7B030-8D3D-4C16-8DB0-73C0A305FE78@webweaving.org> <20170522125307.76c9de6d@gumby.homeunix.com> <1104C7A7-5893-4602-9E34-5C212D987DAE@webweaving.org> <CAOtMX2guiGNaoWd6cqCJiWEE8SLUp1%2B2q87LJ7otM5VfmmSXtA@mail.gmail.com> <20170522143102.70035d8d@gumby.homeunix.com> <CAOtMX2j-Do-hvOE5-oVXb2ygA=%2BzvT2zyrVgAbKD6jwP_VHFAQ@mail.gmail.com> <20170523233057.59cd2393@gumby.homeunix.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, May 23, 2017 at 4:30 PM, RW via freebsd-hackers
<freebsd-hackers@freebsd.org> 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
>> <freebsd-hackers@freebsd.org> 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAOtMX2g=YuSUYTXWvuuKR1KJ8eDhQsHVQ12juC7ckfRUCRb7zQ>