Mailing List Archive

Fedora sa-update and systemd randomized timer
With the discussion of the KAM channel and Fedora's sa-update script that
uses directory-based channel configuration, I went snooping into their
script and systemd units. It looks like sa-update.cron has a 2-hour random
delay before it looks for updates. I'm thinking it would be nice to move
that delay into the systemd timer unit using the RandomizedDelaySec
feature. This would allow the script to be run from the command line for
immediate testing without waiting for the delay. The delay would be done by
systemd, instead. The delay in the script should be configurable and able
to be disabled in /etc/sysconfig/spamassassin, anyway. (For example, if it
was to be used with the pre-systemd RHEL 6.) I'm throwing this here in case
anyone sees a reason not to do this, before opening a bugzilla.
Re: Fedora sa-update and systemd randomized timer [ In reply to ]
Sounds good here. All saupdate does is a very lightweight DNS check.

On Thu, Dec 31, 2020, 19:54 Kenneth Porter <shiva@sewingwitch.com> wrote:

> With the discussion of the KAM channel and Fedora's sa-update script that
> uses directory-based channel configuration, I went snooping into their
> script and systemd units. It looks like sa-update.cron has a 2-hour random
> delay before it looks for updates. I'm thinking it would be nice to move
> that delay into the systemd timer unit using the RandomizedDelaySec
> feature. This would allow the script to be run from the command line for
> immediate testing without waiting for the delay. The delay would be done
> by
> systemd, instead. The delay in the script should be configurable and able
> to be disabled in /etc/sysconfig/spamassassin, anyway. (For example, if it
> was to be used with the pre-systemd RHEL 6.) I'm throwing this here in
> case
> anyone sees a reason not to do this, before opening a bugzilla.
>
>
Re: Fedora sa-update and systemd randomized timer [ In reply to ]
On Thu, 31 Dec 2020 16:54:15 -0800
Kenneth Porter wrote:

> With the discussion of the KAM channel and Fedora's sa-update script
> that uses directory-based channel configuration, I went snooping into
> their script and systemd units. It looks like sa-update.cron has a
> 2-hour random delay before it looks for updates. I'm thinking it
> would be nice to move that delay into the systemd timer unit using
> the RandomizedDelaySec feature. This would allow the script to be run
> from the command line for immediate testing without waiting for the
> delay. The delay would be done by systemd, instead.

I don't know whether this is completely specific to Fedora and
systemd, but if you want it to be more generic you can do following in
the script:

if ! [ -t 0 ]; then
do_random_delay
fi