### begin setup network namespace ###
case $HOSTNAME in
- $MAIL_HOST)
+ $MAIL_HOST|bk)
reload=false
for unit in exim4 spamassassin; do
f=/etc/systemd/system/$unit.service.d/nn.conf
### end setup network namespace ###
+# 2020-10-19 remove old file. remove this when all hosts updated
+rm -fv /etc/systemd/system/spamddnsfix.{timer,service}
+
case $HOSTNAME in
$MAIL_HOST)
# per readme.debian
m systemctl enable spamassassin
m systemctl start spamassassin
m systemctl reload spamassassin
-
- cat >/etc/systemd/system/spamddnsfix.service <<'EOF'
-[Unit]
-Description=spamd dns bug fix cronjob
-
-[Service]
-Type=oneshot
-ExecStart=/a/bin/distro-setup/spamd-dns-fix
-EOF
- # 2017-09, debian closed the bug on this saying upstream had fixed it.
- # remove this when i\'m using the newer package, ie, debian 10, or maybe
- # ubuntu 18.04.
- cat >/etc/systemd/system/spamddnsfix.timer <<'EOF'
-[Unit]
-Description=run spamd bug fix script every 10 minutes
-
-[Timer]
-OnActiveSec=60
-# the script looks back 9 minutes into the journal,
-# it takes a second to run,
-# so lets run every 9 minutes and 10 seconds.
-OnUnitActiveSec=550
-
-[Install]
-WantedBy=timers.target
-EOF
- m systemctl daemon-reload
- m systemctl restart spamddnsfix.timer
- m systemctl enable spamddnsfix.timer
;;
esac
+++ /dev/null
-#!/bin/bash
-
-set -eE -o pipefail
-trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR
-
-[[ $EUID == 0 ]]
-
-# to deal with this bug until it\'s fixed
-# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=741521
-# I just happened to notice it in my journal.
-str="dns: sendto() to \S\+ failed: Connection refused, failing over"
-if journalctl --since=-9m --unit=spamassassin | \
- grep "$str" &>/dev/null; then
- echo "dns bug, restarting spamassassin"
- systemctl restart spamassassin
-fi