Bug 1990604

Summary: sa-update.cron does not restart services on EL6 after rules update
Product: [Fedora] Fedora Reporter: Simon Matter <simon.matter>
Component: spamassassinAssignee: Kevin Fenzi <kevin>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: jskarvad, kevin, nb, olysonek-foss, pavel, simon.matter
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-08-06 06:48:33 UTC 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 Simon Matter 2021-08-05 17:35:11 UTC
Description of problem:
The sa-update.cron script does not restart services after doing the rules update when running on old style init systems like EL6.

Version-Release number of selected component (if applicable):
3.4.6

How reproducible:
Always

Steps to Reproduce:
1. Install spamassassin and some daemon using it, like spampd.
2. Wait for sa-update to do its work called by cron.
3. If there was a rule update, check if services have been restarted.

Actual results:
Services like spampd are not being restarted/reloaded.

Expected results:
Services like spampd should be restarted/reloaded.

Additional info:
This only happens when running from cron, because $PATH is not set correctly. Running the script from the shell as root makes it work.

The reason is that the environment doesn't include /sbin,/usr/sbin in the $PATH. It's a security thing for cron jobs but in this case, it doesn't make sense for a cron job which is run as root.

Following patch fixes the issue:

--- sa-update.cronscript.orig	2021-08-05 19:21:33.257594729 +0200
+++ sa-update.cronscript	2021-08-05 10:01:02.000000000 +0200
@@ -5,6 +5,9 @@
 #     Place files here to add custom channels.
 #
 
+# Set up a default search path
+export PATH="/sbin:/usr/sbin:/bin:/usr/bin"
+
 # Proceed with sa-update if spam daemon is running or forced in /etc/sysconfig/sa-update
 unset SAUPDATE OPTIONS DEBUG NOTIFY_UPD
 [ -f /etc/sysconfig/sa-update ] && . /etc/sysconfig/sa-update


I know, EL6 is not officially supported anymore. But, because this spamassassin package is tailored to build on a lot of older distributions, it would still be nice to have the script fixed.

Thanks,
Simon

Comment 1 Pavel Zhukov 2021-08-06 06:48:33 UTC
Red Hat Enterprise Linux 6 is in the Maintenance Support 2 Phase. During the Maintenance Support 2 Phase, Critical impact Security Advisories (RHSAs) and selected Urgent Priority Bug Fix Advisories (RHBAs) may be released as they become available.

The official life cycle policy can be reviewed here:
http://redhat.com/rhel/lifecycle

This issue does not meet the inclusion criteria for the Maintenance Support 2 Phase and will be marked as CLOSED/WONTFIX. If this remains a critical requirement, please contact Red Hat Customer Support to request a re-evaluation of the issue, citing a clear business justification.  Red Hat Customer Support can be contacted via the Red Hat Customer Portal at the following URL:

https://access.redhat.com