Date: Sun, 7 Jul 2019 17:15:45 +0000 (UTC) From: Ian Lepore <ian@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349807 - head/usr.sbin/periodic/etc/daily Message-ID: <201907071715.x67HFjCK027276@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: ian Date: Sun Jul 7 17:15:45 2019 New Revision: 349807 URL: https://svnweb.freebsd.org/changeset/base/349807 Log: Eliminate spurious periodic.daily error message for rotating accounting log. In 2011, r218961 removed local code for rotating logs in favor of using the rotate_log command in etc/rc.d/accounting. If the accounting service is activated then subsequently de-activated in rc.conf but still remains active in periodic.conf, then you get an error message every day in the periodic jobs about being unable to rotate the logs. With this change to use "onerotate_log", the log rotation will happen the first time periodic daily runs after accounting was disabled but periodic accounting was left enabled. After that happens once, the /var/account/acct will no longer exist, which results in a different path through the periodic code and no more error messages will appear (unless daily_show_badconfig is set, in which case the admin will be told that periodic security processing is enabled but the accounting file is not present). This is only a partial fix for the problems reported in PR 202203. PR: 202203 Modified: head/usr.sbin/periodic/etc/daily/310.accounting Modified: head/usr.sbin/periodic/etc/daily/310.accounting ============================================================================== --- head/usr.sbin/periodic/etc/daily/310.accounting Sun Jul 7 14:20:14 2019 (r349806) +++ head/usr.sbin/periodic/etc/daily/310.accounting Sun Jul 7 17:15:45 2019 (r349807) @@ -47,7 +47,7 @@ case "$daily_accounting_enable" in n=$(($n - 1)) done - /etc/rc.d/accounting rotate_log || rc=3 + /etc/rc.d/accounting onerotate_log || rc=3 rm -f acct.merge && cp acct.0 acct.merge || rc=3 sa -s $daily_accounting_flags /var/account/acct.merge || rc=3
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201907071715.x67HFjCK027276>