From nobody Tue Feb 28 17:00:33 2023 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 4PR3XK2b0Vz3tgMB; Tue, 28 Feb 2023 17:00:33 +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 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PR3XK27tWz3NLX; Tue, 28 Feb 2023 17:00:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677603633; 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=qf5JoL61/mfx9XR/E39Sv3w1pZcvK6clpI31JM5J244=; b=JePpB4XZL5/J9sz+xfmTbKi7i7qc3HZShMaTCaKeyZ6hj/kDOtOkIQgQfdewD3pgpovQda yDToIiIEK5UxkyP0AlhAMO7tE6A3yVLxjT274Ied/jQ57upcWawBLYwdUzt4D2zEx5bP/n lVX4Y+s5v42G3inMo+zlzL3a7ZElu+UJn33GwSiIxyObE66V8PGx2txuav12/iRTZjo2Fo +SCvXIiyEjlJfVVxiBNgbI3v5wblSZMMzZhx5WtuiFaGovKi+ySQcgbCyOzD8ofBbmLbzz pGnYpkLURgrCFuehCPjHAwa0gUjANaMoBP8yYIEFjyOFIFhzoLLVBzcp9EZI8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677603633; 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=qf5JoL61/mfx9XR/E39Sv3w1pZcvK6clpI31JM5J244=; b=E8SpxcadjREGmHHlTwF/KW2aIBT91NKXSkMKYGAC1kh+J/921pzPIUETuinK01n+39Zsz/ JzDEcMNYb2nJHSqCyTd5Owy39pxqDpsa3KPyeVevY5eG84gBHCbuQeirD5ZXM4FWt+/tqJ mM8a0VhGWK4vw+IDUZOn0TjfLLZNs0tVK2mF2a4iF6bnFhx9cbSUiiJs78kfb0rwaOzpfr hTURQ3FXf8CTutSAt8Li14ssZUDmB9Qsvr/CMFRelKqeoq35SCkIQrUj8C0D0lLYcSMHeo HSaZ4TJiK6HiV5rtsstJ4XlpWFMAw0strEuwaW0Gw9826Tl4J7jz7W1DiQamBg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677603633; a=rsa-sha256; cv=none; b=ag2nCAhNl26Sk1C7zAMzO8ocsQcm5tLeJk/cB/77pGp2Tw4dCuc/5YktpzdU00cG0lpmBW lYXkRlAwx8q1XRrc4s1y/2Xj4Gt1+T3mRkBDzpxtRL9dInKnP/Hi1MmPvRub6Im3o3jR37 aP+E/GTapdYY8+a8E+oIxh2FgMti4pHghZODALi22JGmW1kPyryouW/EQ6FoDYPaqdIHsB MVMAWXZ9YJz1X2BxbkGRfYUqdl66yYJm+SmIarcBaHyvpJkymU5UHWwQgu31//NiACeIXN NuHeISoaqJSHYCmV+GPauDuVFFNAHZmg6/wjHEDWxYh6eyV6hNWOg4rnbg6u3Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PR3XK1CxVz1DrZ; Tue, 28 Feb 2023 17:00:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 31SH0X2J079186; Tue, 28 Feb 2023 17:00:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31SH0XgV079185; Tue, 28 Feb 2023 17:00:33 GMT (envelope-from git) Date: Tue, 28 Feb 2023 17:00:33 GMT Message-Id: <202302281700.31SH0XgV079185@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 9ab40bc40d4a - main - 310.accounting: Verify process accounting is active before log rotation. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9ab40bc40d4a07e1a9f3622a7779312ca2466b55 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=9ab40bc40d4a07e1a9f3622a7779312ca2466b55 commit 9ab40bc40d4a07e1a9f3622a7779312ca2466b55 Author: John Grafton AuthorDate: 2023-02-28 16:49:40 +0000 Commit: Warner Losh CommitDate: 2023-02-28 16:59:34 +0000 310.accounting: Verify process accounting is active before log rotation. This corrects a bug in which the daily periodic script '310.accounting' attempts to rotate logs via /etc/rc.d/accounting by calling onerotate_logs function. The rotate logs function turns accounting back on regardless of what acccounting_enable is set to in /etc/rc.conf. This is due to checkyesno always returning YES since rotate logs is called with the 'one' prefix. In effect, accounting will always be turned back on once a day even if it is disabled and stopped by hand. The fix was simple, just check if accounting is before rotating logs and if it is, don't attempt the rotate. PR: 267464 Reviewed by: imp, hps (lgtm, not approval), Mina Galić Pull Request: https://github.com/freebsd/freebsd-src/pull/648 Differential Revision: https://reviews.freebsd.org/D37434 --- usr.sbin/periodic/etc/daily/310.accounting | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/usr.sbin/periodic/etc/daily/310.accounting b/usr.sbin/periodic/etc/daily/310.accounting index b0dd786447eb..8eeed16f0516 100755 --- a/usr.sbin/periodic/etc/daily/310.accounting +++ b/usr.sbin/periodic/etc/daily/310.accounting @@ -18,6 +18,11 @@ case "$daily_accounting_enable" in echo '$daily_accounting_enable is set but /var/account/acct' \ "doesn't exist" rc=2 + elif [ $(sysctl -n kern.acct_configured) -eq 0 ] + then + echo '$daily_accounting_enable is set but' \ + 'process accounting is not active' + rc=2 elif [ -z "$daily_accounting_save" ] then echo '$daily_accounting_enable is set but ' \