Re: Should we add jitter to cron(8) ?

From: Sulev-Madis Silber <freebsd-current-freebsd-org111_at_ketas.si.pri.ee>
Date: Tue, 03 Nov 2026 12:16:31 UTC

On November 3, 2026 1:59:59 AM GMT+02:00, "Enji Cooper (yaneurabeya)" <yaneurabeya@gmail.com> wrote:
>
>> On Nov 2, 2026, at 10:58 AM, Sulev-Madis Silber <freebsd-current-freebsd-org111@ketas.si.pri.ee> wrote:
>> 
>> On November 2, 2026 8:28:09 PM GMT+02:00, "Enji Cooper (yaneurabeya)" <yaneurabeya@gmail.com> wrote:
>>> 
>>>> On Nov 2, 2026, at 9:10 AM, Jamie Landeg-Jones <jamie@catflap.org> wrote:
>>>> 
>>>> Peter Jeremy <peterj@FreeBSD.org> wrote:
>>>> 
>>>>> IMO, it would be useful to have a way of saying e.g. "run once an hour
>>>>> but I don't care when within the hour".
>>>> 
>>>> I assume that the time within the hour would be the same each hour? If so,
>>>> that would be useful.
>>>> 
>>>> But would than initial state random number be stored somewhere, or reset
>>>> each time cron starts?
>>> 
>>> <2 cents> (deflated)
>>> It would probably be better if the state was tracked at the system level instead of in the application itself.
>>> 
>>> As a bonus, employing jitter might improve overall system-level entropy, depending on how jobs are run and when, which could help cryptography some.
>>> </2 cents>
>>> 
>>> Thanks,
>>> -Enji
>> 
>> what if (embedded) system with read-only filesystem reboots?
>
>Wouldn’t that suffer the same issues as cron-saved entropy data?
>-Enji

side question: are ro systems more insecure or it still gets enough seed for csprng on nowadays hw? and are rw systems less secure in first boot? we no longer require user to write screen full of chars at boot. does it matter if we save it over boots? or it's still fine if live collected. i'm not familiar with this subject

but as for cron, yeah no idea what will happen then, will it run multiple times? how do you know if task has been ran if it's supposed to run some time inside hour

oh and then comes the cursed cron @reboot which is so useful to start stuff but won't run at reboot at all, rather every cron restart. granted, most of machines run cron from boot to halt in one go, but things happen. one could save it if you can, works even with tmpfs /var/run, but then what if it's bad