From c934f2a574e246eef0e27558d310952e5524e85e Mon Sep 17 00:00:00 2001 From: Mike Karels Date: Fri, 16 Dec 2022 09:13:07 -0600 Subject: [PATCH] daily 150.clean-hoststat: suppress error when using dma dma(8) does not have hoststat or purgestat, so this script produces an error from the daily script. We could disable this script, but that would mean yet another change to switch back to sendmail. Check for purgestat in mailer.conf before attempting either hoststat or purgestat. Reviewed by: pstef, bapt Differential Revision: https://reviews.freebsd.org/D37712 --- usr.sbin/periodic/etc/daily/150.clean-hoststat | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/usr.sbin/periodic/etc/daily/150.clean-hoststat b/usr.sbin/periodic/etc/daily/150.clean-hoststat index 460d1a267908..54d4d4c21dab 100755 --- a/usr.sbin/periodic/etc/daily/150.clean-hoststat +++ b/usr.sbin/periodic/etc/daily/150.clean-hoststat @@ -2,7 +2,7 @@ # # $FreeBSD$ # -# Remove stale persistent host status files +# Remove stale persistent host status files if the mailer supports it. # # If there is a global system configuration file, suck it in. @@ -14,7 +14,9 @@ fi case "$daily_clean_hoststat_enable" in [Yy][Ee][Ss]) - if [ -z "$(hoststat 2>&1)" ]; then + if ! grep -q '^purgestat' /etc/mail/mailer.conf; then + rc=3 + elif [ -z "$(hoststat 2>&1)" ]; then rc=2 else echo ""