From 4e735a2e1807351e4a11f2fe4cda427e18e0d550 Mon Sep 17 00:00:00 2001 From: Ian Kelling Date: Wed, 16 Feb 2022 12:48:53 -0500 Subject: [PATCH] standarize restart delays, check that exim is running on remote hosts --- check-mailq | 3 +++ distro-end | 2 +- mail-setup | 16 ++++++++-------- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/check-mailq b/check-mailq index bd79f1d..e84675d 100755 --- a/check-mailq +++ b/check-mailq @@ -7,6 +7,9 @@ if [ -z "$BASH_VERSION" ]; then echo "error: shell is not bash" >&2; exit 1; fi set -eE -o pipefail trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR +if ! systemctl is-active --quiet exim4; then + systemctl status exim4 +fi qlen=$(/usr/sbin/exiqgrep -o 60 -c -b | awk '{print $1}') if [[ $qlen != 0 ]]; then printf "%s" $qlen diff --git a/distro-end b/distro-end index 67e7a4e..8dba035 100755 --- a/distro-end +++ b/distro-end @@ -583,7 +583,7 @@ StartLimitIntervalSec=0 [Service] Restart=always -RestartSec=60 +RestartSec=20 EOF if $reload; then ser daemon-reload; fi sgo wg-quick@wghole diff --git a/mail-setup b/mail-setup index 4325b7a..5c5ccae 100755 --- a/mail-setup +++ b/mail-setup @@ -541,7 +541,7 @@ PrivateNetwork=true BindPaths=$bindpaths Restart=always # time to sleep before restarting a service -RestartSec=1 +RestartSec=20 [Install] WantedBy=multi-user.target @@ -563,7 +563,7 @@ PrivateNetwork=true ExecStart=/usr/bin/flock -w 20 /tmp/newns.flock /a/bin/newns/newns -n 10.173.8 start mail ExecStop=/usr/bin/flock -w 20 /tmp/newns.flock /a/bin/newns/newns stop mail Restart=always -RestartSec=10 +RestartSec=20 [Install] @@ -598,7 +598,7 @@ Type=simple ExecStart=/usr/local/bin/mailbindwatchdog $vpnser ${nn_progs[@]} unbound.service radicale.service Restart=always # time to sleep before restarting a service -RestartSec=1 +RestartSec=10 [Install] WantedBy=multi-user.target @@ -675,7 +675,7 @@ PrivateNetwork=true BindPaths=$bindpaths Restart=always -RestartSec=1 +RestartSec=20 EOF # sooo, there are a few ways to get traffic from the mail network @@ -726,7 +726,7 @@ PrivateNetwork=true BindPaths=$bindpaths Restart=always -RestartSec=1 +RestartSec=20 EOF done ;; @@ -1277,7 +1277,7 @@ PrivateNetwork=true BindPaths=$bindpaths Restart=always # time to sleep before restarting a service -RestartSec=1000 +RestartSec=20 [Install] # for openvpn @@ -2562,7 +2562,7 @@ StartLimitIntervalSec=0 [Service] Restart=always # time to sleep before restarting a service -RestartSec=1 +RestartSec=20 EOF i /etc/default/exim4in <<'EOF' @@ -2677,7 +2677,7 @@ StartLimitIntervalSec=0 [Service] Restart=always -RestartSec=300 +RestartSec=20 EOF else -- 2.30.2