Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 508512

Summary: sys-process/acct - provide logrotate.d entry that works with systemd
Product: Gentoo Linux Reporter: SÅ‚awomir Nizio <slawomir.nizio>
Component: Current packagesAssignee: Gentoo's Team for Core System packages <base-system>
Status: RESOLVED FIXED    
Severity: normal CC: rich0, systemd
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

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!