Bug 2142729

Summary: When running sa-update from the systemd timer unit, use systemd's time randomization
Product: [Fedora] Fedora Reporter: Kenneth Porter <shiva>
Component: spamassassinAssignee: Kevin Fenzi <kevin>
Status: NEW --- QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 38CC: jskarvad, kevin, nb, olysonek-foss, pavel
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: ---
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Kenneth Porter 2022-11-15 05:25:39 UTC
The sa-update.cron script was originally written for use with cron which has no randomization feature, so it includes its own 2-hour random sleep. It would be nice to be able to use the script directly from the command line without a sleep so that the process can be tested immediately, and so that package updates immediately pull the latest rule set instead of waiting for the daily update cycle.

When using a systemd timer unit, the randomization could be done directly in sa-update.timer, and an immediate update could be done using "systemctl start sa-update", bypassing the systemd timer randomization.

So two things would be needed:

1) Detect in the script if it's being run from cron and do the random sleep.
2) Add the 2-hour randomization to the timer unit file.

See also bug 1064537 for when the systemd units were added to this package.

Inspired by Letsencrypt's certbot-renew systemd units.

Comment 1 Ben Cotton 2023-02-07 14:59:06 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 38 development cycle.
Changing version to 38.