Source: spamassassin
Followup-For: Bug #774380

Hi,

> I guess we should simply check if spamd is running before trying to 
> reload it? Is it ok to use pidof?

How about using the status command of the initscript? Patch 
attached ...

It still has inconsistent behaviour because the sysv initscript 
checks ENABLED, but that's another issue.

Bernhard
--- a/debian/spamassassin.cron.daily	2015-05-11 10:38:11.415485334 +0200
+++ b/debian/spamassassin.cron.daily	2015-05-11 10:43:32.733327917 +0200
@@ -49,9 +49,9 @@
 reload() {
     # Reload
     if which invoke-rc.d >/dev/null 2>&1; then
-        invoke-rc.d spamassassin reload > /dev/null
+        invoke-rc.d --quiet spamassassin status > /dev/null && invoke-rc.d spamassassin reload > /dev/null
     else
-        /etc/init.d/spamassassin reload > /dev/null
+        /etc/init.d/spamassassin status > /dev/null && /etc/init.d/spamassassin reload > /dev/null
     fi
     if [ -d /etc/spamassassin/sa-update-hooks.d ]; then
         run-parts --lsbsysinit /etc/spamassassin/sa-update-hooks.d

Reply via email to