Date: Thu, 17 Nov 2022 18:03:34 +0000 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 Message-ID: <bug-267464-227-tjdTOAHSml@https.bugs.freebsd.org/bugzilla/> In-Reply-To: <bug-267464-227@https.bugs.freebsd.org/bugzilla/> References: <bug-267464-227@https.bugs.freebsd.org/bugzilla/>
next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D267464 John Grafton <john.grafton@runbox.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |john.grafton@runbox.com --- Comment #2 from John Grafton <john.grafton@runbox.com> --- 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.=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-267464-227-tjdTOAHSml>