From nobody Wed Nov 11 18:08:35 2026 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4jPs2q2vPVz70YHw for ; Wed, 11 Nov 2026 18:08:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4jPs2q1wY0z3HTg for ; Wed, 11 Nov 2026 18:08:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1794420515; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=O0NsfB6s99aOz5t4uFrXNFh8BPTwToqqmDOTIJfmqjs=; b=JDgc/Pv8udTYIQM0WbNKw1Ys/gSQB3TMFhhkIGjuhPt1ehxKta3xBaASzPoU4lMZHzP7Kb N/eI8u402Yd3rBQ12ktfm9xbrOl0a4958477GVsB0atsEfbt2MBp6Dz9h+PnfahcEq5ePY vxFH3F6IqFsjCoN/WHFeRrdcVMllhyAKifi+nEsuHzdjY+JbWJXgRvPD6Ksw/bZzXuaPiB NipUhV+N80gRCGfSYqHhpBLM9Bw0LA2j2QglLIjP5nYn5Gcv3AP2fwqIqUhtiv9XyEpxX4 zZQc12/T2N7j2Cxu0TtMoCi5k4l9e4fXcia5V6pI7A5mgLj3Pa0KsgjP+pZvyA== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1794420515; b=jEzKpO8CXkAISPSPTodSp9RJCIQB7YfG49zsP/eoFJvCDXxPRfvbGujTQYSIvdyDdhDa8Z iTonSw32S+h9cZ4sWTYE2MQlzFfPjEEFnJlTjh8Yb5aU8HQFxHBQ0Yw3MIutdQCfxU8jNH wvpAgAJfWxFNgcHlvuZ3hI777nkayRcsZ2N2OsSFCjhr1XnIL+Juxi7q3RzYvNRoGRnSgu h1K4xAT+K2gP10LpnpbIzi+5492Ex9mVw7xpt4LM6DOqxkY+Av5BEJisV1sLJz0K92TCtu oyd9vpMUHTNVIxuL2+RZZTCsAwKwxtrKOcp0y2oWF1r+e7UAH50rso7fE9B8xw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1794420515; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=O0NsfB6s99aOz5t4uFrXNFh8BPTwToqqmDOTIJfmqjs=; b=Xef1dfxNm//cKvHbaOEN4yu8R/b02GPGbI5QXaLlfEGxpcm+y+q2q5oV/j5mBPz2Rjye1h 8ziyTp2Hqc8vdjXgIaileSZ/CcxRKSqfkfZMlB9HC0m2ZlaZm8xpivu7qr2rS7JQfwTiuK 1wBABKpLpfdvsu94Ns+0r8IuqfvfoyAVGOGBvb/cDPjrShyWN/MjT6XWjdtNt/MRFs842m g1j/TjDoNhVyzsCc62T4MNJIu5B34g4ggFjXIhjVH6wxoSoN4MNE4dKR787y/EtpvrjXoH RcL+kohEQ29i9WZIDxqpZ9GDy1nZ3pX2jff7G5p+Zixb96pe4p5UkVjsjp8zkg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4jPs2q1J7WzQ3L for ; Wed, 11 Nov 2026 18:08:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 254e3 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 11 Nov 2026 18:08:35 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dag-Erling=?utf-8?Q? Sm=C3=B8rg?=rav Subject: git: 004bba2b6b0e - main - periodic: Fix empty output check List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all X-BeenThere: dev-commits-src-all@freebsd.org List-Id: Commit messages for all branches of the src repository List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 004bba2b6b0ea5313480be65bc9506c5628e5a78 Auto-Submitted: auto-generated Date: Wed, 11 Nov 2026 18:08:35 +0000 Message-Id: <6af4af23.254e3.2194efc0@gitrepo.freebsd.org> The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=004bba2b6b0ea5313480be65bc9506c5628e5a78 commit 004bba2b6b0ea5313480be65bc9506c5628e5a78 Author: Dag-Erling Smørgrav AuthorDate: 2026-11-11 18:07:57 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2026-11-11 18:07:57 +0000 periodic: Fix empty output check The empty_output variable is normalized to YES or NO, but we were comparing it to TRUE, so the comparison always failed no matter what it was set to. Compare it to YES instead. This feature has been disabled since 2007, so flip the default to NO to preserve the current behavior. Adjust the documentation accordingly. Relnotes: yes PR: 300676 MFC after: 1 week Fixes: 68c35072f914 ("Add an option to make periodic(8) quiet when no output was generated.") Reviewed by: ivy, emaste Differential Revision: https://reviews.freebsd.org/D61435 --- share/man/man5/periodic.conf.5 | 9 ++++++++- usr.sbin/periodic/periodic.8 | 7 +++---- usr.sbin/periodic/periodic.conf | 4 ++++ usr.sbin/periodic/periodic.sh | 4 ++-- 4 files changed, 17 insertions(+), 7 deletions(-) diff --git a/share/man/man5/periodic.conf.5 b/share/man/man5/periodic.conf.5 index 568493154558..5bb8285d7579 100644 --- a/share/man/man5/periodic.conf.5 +++ b/share/man/man5/periodic.conf.5 @@ -23,7 +23,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd June 19, 2026 +.Dd November 11, 2026 .Dt PERIODIC.CONF 5 .Os .Sh NAME @@ -131,6 +131,13 @@ respectively. Refer to the .Xr periodic 8 manual page for how script return codes are interpreted. +.It Ao Ar dir Ac Ns Va _show_empty_output +.Pq Vt bool +Set to +.Dq Li YES +to still send an email even if no output was produced for the scripts +found in +.Ar dir . .It Va anticongestion_sleeptime .Pq Vt int The maximum number of seconds to randomly sleep in order to smooth bursty loads diff --git a/usr.sbin/periodic/periodic.8 b/usr.sbin/periodic/periodic.8 index 0cd57bab27e2..ed5717db7ba6 100644 --- a/usr.sbin/periodic/periodic.8 +++ b/usr.sbin/periodic/periodic.8 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd June 18, 2020 +.Dd November 11, 2026 .Dt PERIODIC 8 .Os .Sh NAME @@ -136,11 +136,10 @@ value does not begin with a .Ql / and is not empty, it is assumed to contain a list of email addresses, and the output is mailed to them. -If +If the script did not produce any output, no email is sent, unless .Ao Ar basedir Ac Ns Va _show_empty_output is set to -.Dq Li NO , -then no mail will be sent if the output was empty. +.Dq Li YES . .Pp If .Ao Ar basedir Ac Ns Va _output diff --git a/usr.sbin/periodic/periodic.conf b/usr.sbin/periodic/periodic.conf index 7066c7b49fd1..c113d60e42c9 100644 --- a/usr.sbin/periodic/periodic.conf +++ b/usr.sbin/periodic/periodic.conf @@ -45,6 +45,7 @@ daily_output="root" # user or /file daily_show_success="YES" # scripts returning 0 daily_show_info="YES" # scripts returning 1 daily_show_badconfig="NO" # scripts returning 2 +daily_show_empty_output="NO" # Don't notify of empty output # 100.clean-disks daily_clean_disks_enable="NO" # Delete files daily @@ -208,6 +209,7 @@ weekly_output="root" # user or /file weekly_show_success="YES" # scripts returning 0 weekly_show_info="YES" # scripts returning 1 weekly_show_badconfig="NO" # scripts returning 2 +weekly_show_empty_output="NO" # Don't notify of empty output # 310.locate weekly_locate_enable="YES" # Update locate weekly @@ -240,6 +242,7 @@ monthly_output="root" # user or /file monthly_show_success="YES" # scripts returning 0 monthly_show_info="YES" # scripts returning 1 monthly_show_badconfig="NO" # scripts returning 2 +monthly_show_empty_output="NO" # Don't notify of empty output # 200.accounting monthly_accounting_enable="YES" # Login accounting @@ -259,6 +262,7 @@ monthly_local="/etc/monthly.local" # Local scripts security_show_success="YES" # scripts returning 0 security_show_info="YES" # scripts returning 1 security_show_badconfig="NO" # scripts returning 2 +security_show_empty_output="NO" # Don't notify of empty output # These options are used by the security periodic(8) scripts spawned in # daily and weekly 450.status-security. diff --git a/usr.sbin/periodic/periodic.sh b/usr.sbin/periodic/periodic.sh index a310f04864da..a34e28e41654 100644 --- a/usr.sbin/periodic/periodic.sh +++ b/usr.sbin/periodic/periodic.sh @@ -98,7 +98,7 @@ export PERIODIC="$arg${PERIODIC:+ }${PERIODIC}" # set, assume the user didn't really want us to muck with it (it's a # README file or has been disabled). -success=YES info=YES badconfig=NO empty_output=YES # Defaults when ${run}_* aren't YES/NO +success=YES info=YES badconfig=NO empty_output=NO # Defaults when ${run}_* aren't YES/NO for var in success info badconfig empty_output; do case $(eval echo "\$${arg##*/}_show_$var") in [Yy][Ee][Ss]) eval $var=YES;; @@ -144,7 +144,7 @@ esac done done if [ $empty = TRUE ]; then - if [ $empty_output = TRUE ]; then + if [ $empty_output = YES ]; then [ $processed = 1 ] && plural= || plural=s echo "No output from the $processed file$plural processed" fi