Commit 85dba3a0 authored by Vladimir Bashkirtsev's avatar Vladimir Bashkirtsev

Spamassassin should not attempt to start before rules are updated and be...

Spamassassin should not attempt to start before rules are updated and be restarted straight after rules update
parent 84767a0a
...@@ -17,6 +17,7 @@ define SPAMASSASSIN_SERVICE ...@@ -17,6 +17,7 @@ define SPAMASSASSIN_SERVICE
Description=Spamassassin daemon Description=Spamassassin daemon
After=syslog.target network.target After=syslog.target network.target
Wants=sa-update.timer Wants=sa-update.timer
ConditionDirectoryNotEmpty=/etc/mail/spamassassin/sa-update-keys
[Service] [Service]
ExecStart=/usr/bin/spamd ExecStart=/usr/bin/spamd
...@@ -74,7 +75,7 @@ Description=Spamassassin Rules Update timer ...@@ -74,7 +75,7 @@ Description=Spamassassin Rules Update timer
Documentation=man:sa-update(1) Documentation=man:sa-update(1)
[Timer] [Timer]
OnBootSec=5 min OnBootSec=3 min
OnUnitActiveSec=1 day OnUnitActiveSec=1 day
[Install] [Install]
......
...@@ -11,7 +11,7 @@ now=`date +"%d-%b-%Y %T"` ...@@ -11,7 +11,7 @@ now=`date +"%d-%b-%Y %T"`
if [ $status -eq 0 ]; then if [ $status -eq 0 ]; then
echo "$now: SpamAssassin: Update processed successfully" echo "$now: SpamAssassin: Update processed successfully"
systemctl condrestart spamassassin.service >& /dev/null systemctl --quiet is-enabled spamassassin.service; [ $? -eq 0 ] && systemctl restart spamassassin.service >& /dev/null
systemctl --quiet is-active mimedefang.service; [ $? -eq 0 ] && systemctl reload mimedefang.service >& /dev/null systemctl --quiet is-active mimedefang.service; [ $? -eq 0 ] && systemctl reload mimedefang.service >& /dev/null
exit $status exit $status
fi fi
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment