From nobody Thu Nov 17 18:03:34 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 4NCnpb0lwkz4htdj for ; Thu, 17 Nov 2022 18:03:35 +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 4NCnpZ4MHQz44GS for ; Thu, 17 Nov 2022 18:03:34 +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=1668708214; 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=JmMt5h7ukNoRAAMRCGMkq3cqyvIlvJ9/nFNc3pRKGM0=; b=RWAEViLXVBkKhvPBw9297DPxrPOai2oScVOgGrKB8/UwN8+YjW4s2a9JtgBhoGRn7ETvz1 3dU/0dtwSUOB4AVFoKWgafboZeLwWe1789laFwlUgDlouOZaCaRW8e5TGY2zXZCtHw06jj DohWb4qPwQ0nHwo7qcizxZ7Q3g3mgt1mitGFs31DxAi1Znw/ho5jCWk8TimtaHGxo8vPd7 S+CaHiBBr9G0NSixdsW2muQIzuo4B7EUUPy5cX8y7otO6PxOYmwGK0BM3w09z+nMoyVGFd YPYk2ajtnoS3DByIgKm3pdfyET0OKKsPxC9ZnK+bd15VQIv66RJI+Cq/J84IUQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1668708214; a=rsa-sha256; cv=none; b=IXNhb4hKvrUoL/shVCJLc3XGu7Uww8Uz3vSUMv4HKPy3ijyXcZlOblxw8M+TXvd9kzJs6O Ea8UTXl9L3wL5Vas49QYAj2udKIsjgi7OgyeVPqe6C2Xyqf6iuTLbdQbUBQWu1BFzos9+d 2E6EdqrhXRt8TEU8sNNvIssjTzCZ7xAmtWxYRVDjCFOePeUhuD1IQOTmxGfOwicFN9qbvt R/TWnCKBRys+agLoXIMwEJfamcWSIZmMUNc8TUGCfJPqyJ49oqDWHFVo2UGl9wakhWbB2u KyNkBHMsao9HhQb+zlGGHUz9p8vP24naQPiQ/6OuZlJ0kj1dAuWW0HgVRrwEPg== 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 4NCnpZ3RJlzrD7 for ; Thu, 17 Nov 2022 18:03:34 +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 2AHI3Y56057936 for ; Thu, 17 Nov 2022 18:03:34 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 2AHI3Yla057935 for bugs@FreeBSD.org; Thu, 17 Nov 2022 18:03:34 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: Thu, 17 Nov 2022 18:03:34 +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: cc 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 John Grafton changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |john.grafton@runbox.com --- Comment #2 from John Grafton --- I was able to replicate this bug on my system. I think a simple fix is to check if the accounting system process is running in the periodic script. If not, exit the periodic script indicating the service is not running instead= of attempting to rotate the logs. onerotate_log turns accounting back on regardless of what accounting_enable is set to. I tested this patch on my local system and the periodic log rotate exits and doesn't restart the accounting service if the [accounting] process is not running. diff --git a/usr.sbin/periodic/etc/daily/310.accounting b/usr.sbin/periodic/etc/daily/310.accounting index b0dd786447eb..6a47690a0a6a 100755 --- a/usr.sbin/periodic/etc/daily/310.accounting +++ b/usr.sbin/periodic/etc/daily/310.accounting @@ -18,6 +18,10 @@ case "$daily_accounting_enable" in echo '$daily_accounting_enable is set but /var/account/acct' \ "doesn't exist" rc=3D2 + elif ! pgrep -qS accounting + then + echo 'accounting service 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.=