From nobody Fri Nov 18 01:39:41 2022 X-Original-To: bugs@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 4NCzws5qpqz4hnkN for ; Fri, 18 Nov 2022 01:39:41 +0000 (UTC) (envelope-from bugzilla-noreply@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 4NCzws4kRXz3t9g for ; Fri, 18 Nov 2022 01:39:41 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1668735581; 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: in-reply-to:in-reply-to:references:references; bh=Xy19CbOyH0bVyEzttH14Jas5qxN6oyKqqVlI34iWYdI=; b=QND3f1Tdg+hccDIIpbTXl6ua0Kr80CWNw26GNFGdXNP400dFIzSpmoLQGtvRVdM5l0aCZk RtBzF54eOlkgumHQtbRoyp9xwWym/d8SxGbFrLtHTA70+be+YqZrN8n4m+y6L37KJFK9i6 hA39xLG9rmnd8MxUWgtaEb1NZs5zZe5xhISTaYtUYIBzKZSHw/3Yt9vd0qAxLKSTZqHbI+ N8WpIYKTyQSRt8lsmRqtWAbkdBpwfdAEblb3RbZDQJ53QJzzKbJY3Py5uxhQ7wytGswYMK 4b+NaBLZf4n9BaH6rQN76k2y/8dgoRP3MKSvcOM/kTsiSJNi9xEIlOsqGsTjcQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1668735581; a=rsa-sha256; cv=none; b=X5frD2gEOk18ouCPLv8CUf2a8r0FavJwYtqKg5V7dRjIagDMbaSOj7hNwHnF86Hm5evhgE FiKOGs98rOm6xpBFkxzrnEId8V78FcTbGSSUDYzSQyCpih5nVotk7duaTmUx29RGVQRqq6 vhnHoBm/YVe9AzidRfPUY78DvePBxahrB1YWnXHzRigQwTvHqb2+o8BYCGfct5HhJy55eU jRoWlM2Yhj6qsFZWUQcYaBD91q9DdgwQL+6ImXPcC8hJzdSkNKwecs5YxoW/yudqdSfgik kGr+udy9EgRSWnPEiHIVBID/txw6g6l4FZGRBE/9m5OSEhKsuNvSiUrMeeUOJw== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (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 4NCzws3qCwz13lf for ; Fri, 18 Nov 2022 01:39:41 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 2AI1dfHn005631 for ; Fri, 18 Nov 2022 01:39:41 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 2AI1dfaL005630 for bugs@FreeBSD.org; Fri, 18 Nov 2022 01:39:41 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 267464] periodic 310.accounting enables accounting even if it is disabled in rc.conf Date: Fri, 18 Nov 2022 01:39:41 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: conf X-Bugzilla-Version: 13.1-RELEASE X-Bugzilla-Keywords: needs-qa X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: john.grafton@runbox.com X-Bugzilla-Status: Open X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@freebsd.org MIME-Version: 1.0 X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D267464 --- Comment #3 from John Grafton --- Ignore the last patch, it's too hacky. Grepping for the system process is problematic due to the possibility of a process other than accounting retur= ning true for the grep. This patch uses the kern.acct_configured sysctl to determine if accounting = is active instead. 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=3D2 + elif [ $(sysctl -n kern.acct_configured) -eq 0 ] + then + echo '$daily_accounting_enable is set but' \ + 'process accounting is not active' + rc=3D2 elif [ -z "$daily_accounting_save" ] then echo '$daily_accounting_enable is set but ' \ --=20 You are receiving this mail because: You are the assignee for the bug.=