Bug 217055 - Consolidate random sleeps in periodic scripts

Martin S. Weber Ephaeton at gmx.net
Wed Feb 15 13:17:51 UTC 2017


On 2017-02-14 09:29:47, Alan Somers wrote:
> Ok, the consensus opinion seems to be that:
> 1) A single sleep would be better than 3 sleeps
> 2) Periodic shouldn't sleep if no script requires it
> 3) Nothing should be backgrounded
> 4) Periodic shouldn't sleep when run interactively.
> 
> I can achieve all of this by putting a common sleep function in
> /etc/defaults/periodic.conf.  Some passing of environment variables
> will be required.  I'll put everyone on the code review when it's
> ready.

You can achieve all of this by teaching crond to introduce the random
jitter itself as well and keep the whole rc.d scripts sleep-less. This
would automatically fix periodic incantations from the command lines.
Then in the system crontab (no, not root's crontab as is wrongly documented),
just add the JITTER=3600 or equivalent to vary calls by up to an hour
(or whatever mileage you prefer) and we're all happy ;)

Regards,
-Martin


More information about the freebsd-pkg mailing list