Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 508512 - sys-process/acct - provide logrotate.d entry that works with systemd
Summary: sys-process/acct - provide logrotate.d entry that works with systemd
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-23 14:09 UTC by Sławomir Nizio
Modified: 2017-07-27 14:08 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sławomir Nizio 2014-04-23 14:09:09 UTC
This package installs systemd unit, yet its logrotate file assumes OpenRC.

Reproducible: Always
Comment 1 Richard Freeman gentoo-dev 2015-12-29 13:20:51 UTC
The following script should work:

# Logrotate file for acct

/var/account/pacct {
        compress
        delaycompress
        notifempty
        daily
        rotate 31
        create 0600 root root
        missingok
        postrotate
                systemctl try-restart acct
        endscript
}


Note that it doesn't work with openrc.

You could just do both.  Test for whether openrc is installed, and if so call the existing line.  Then test for whether systemctl exists and if so call the new one.

I wouldn't just call the init.d script - I'm not sure how that will behave if openrc isn't installed, and there is an effort underway to remove it from the system set.
Comment 2 Thomas Deutschmann (RETIRED) gentoo-dev 2017-07-27 14:08:31 UTC
Fixed via https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ce3320b8f7c1530d7438cd4774a72a75266e1c0b

Thanks for the report!