Summary: | sys-process/acct should include a logrotate script | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Jeremy Sermersheim <jsermer> |
Component: | Current packages | Assignee: | Gentoo's Team for Core System packages <base-system> |
Status: | RESOLVED FIXED | ||
Severity: | enhancement | CC: | barzog, jer |
Priority: | High | Keywords: | Inclusion |
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: | logrotate script for sys-process/acct |
Description
Jeremy Sermersheim
2010-04-04 16:03:09 UTC
Created attachment 226561 [details]
logrotate script for sys-process/acct
i also modified the /etc/init.d/acct script and added 'off' to the 'accton' line in the stop stanza: stop() { ebegin "Stopping accounting" accton off eend $? } another note....the ebuild should contain the /var/account/pacct file as a null file with the proper ownership/permissions otherwise logrotate will complain about the file not being present (In reply to comment #2) > i also modified the /etc/init.d/acct script and added 'off' to the 'accton' > line in the stop stanza: > > stop() { > ebegin "Stopping accounting" > accton off > eend $? > } > That's already fixed through bug #316517. I've added your suggested script in sys-process/acct-6.5.4-r1. Thanks for reporting and for the script! If acct daemon is not started logrotate always fails with error: /var/account/pacct: No such file or directory. Therefore /etc/logrotate.d/acct should include 'missingok' directive. Without missingok: albatros2 ~ # logrotate -v /etc/logrotate.d/acct reading config file /etc/logrotate.d/acct reading config info for /var/account/pacct Handling 1 logs rotating pattern: /var/account/pacct after 1 days (31 rotations) empty log files are not rotated, old logs are removed considering log /var/account/pacct error: stat of /var/account/pacct failed: Нет такого файла или каталога With missingok: albatros2 ~ # logrotate -v /etc/logrotate.d/acct reading config file /etc/logrotate.d/acct reading config info for /var/account/pacct Handling 1 logs rotating pattern: /var/account/pacct after 1 days (31 rotations) empty log files are not rotated, old logs are removed considering log /var/account/pacct log /var/account/pacct does not exist -- skipping not running prerotate script, since no logs will be rotated not running postrotate script, since no logs were rotated (In reply to comment #6) > If acct daemon is not started logrotate always fails with error: RCS file: /var/cvsroot/gentoo-x86/sys-process/acct/files/acct.logrotate,v Working file: files/acct.logrotate head: 1.2 branch: locks: strict access list: symbolic names: keyword substitution: kv total revisions: 2; selected revisions: 2 description: ---------------------------- revision 1.2 date: 2010-11-11 08:52:10 +0100; author: jer; state: Exp; lines: +1 -0; commitid: 1 2924cdba0aa4567; Add missingok by Tom Hendrikx (bug #344963). (Portage version: 2.1.9.24/cvs/Linux i686) Please don't hijack seemingly related bug reports. |