You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by Kenneth Porter <sh...@sewingwitch.com> on 2021/01/01 00:54:15 UTC

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

Posted by "Kevin A. McGrail" <km...@apache.org>.
Sounds good here. All saupdate does is a very lightweight DNS check.

On Thu, Dec 31, 2020, 19:54 Kenneth Porter <sh...@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

Posted by RW <rw...@googlemail.com>.
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