Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 357275 - app-admin/logrotate: logrotate.status should not reside in /var/lib
Summary: app-admin/logrotate: logrotate.status should not reside in /var/lib
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Chema Alonso Josa (RETIRED)
Depends on: CVE-2011-1098
  Show dependency tree
Reported: 2011-03-03 21:32 UTC by William L. Thomson Jr.
Modified: 2021-07-30 08:39 UTC (History)
4 users (show)

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


Note You need to log in before you can comment on or make changes to this bug.
Description William L. Thomson Jr. 2011-03-03 21:32:50 UTC
Filed with upstream, but can address on Gentoo till they get around to it. Please see upstream bug for details and patch.
Comment 1 Daniel Gryniewicz (RETIRED) gentoo-dev 2011-03-04 00:22:21 UTC
There's going to be a whole lot of changes (possibly a new release?) soon, so I'd prefer to wait for that to avoid an extra bump.
Comment 2 William L. Thomson Jr. 2011-03-04 00:26:02 UTC
Sure no rush, just not sure how fast upstream will respond and its pretty minor change. When ever you get around to doing a new release or what ever, if upstream hasn't acted, would be great if you could slip the minor change in there. I can work around it in the mean time. It is not a major issue.
Comment 3 William L. Thomson Jr. 2011-03-08 23:56:36 UTC
Looks like upstream is moving on this, so I wouldn't worry about it directly. I will close this bug when upstream addresses the issue in a new release of logrotate. Just using this for tracking purposes.
Comment 4 Chema Alonso Josa (RETIRED) gentoo-dev 2012-06-10 21:26:45 UTC
Taken maintainership of package
Comment 5 William L. Thomson Jr. 2017-08-02 15:32:52 UTC
Over 6 years later, I think the patch should be applied....
Comment 6 Chema Alonso Josa (RETIRED) gentoo-dev 2017-08-03 21:42:45 UTC
Thanks for reminding this. The ticket got lost.

Filing new issue at current upstream:
Comment 7 William L. Thomson Jr. 2017-08-04 03:10:05 UTC
No problem I did not realize it went to github. I will see about filing a PR. Thanks for the issue there. I added myself to notifications to follow that as well.
Comment 8 William L. Thomson Jr. 2017-08-04 14:33:18 UTC
Looks like this has been addressed and is now a configure option so 100% Gentoo specific.

Need to see about setting --with-state-file-path. I guess it would go in some subdir of /var/lib. I will leave that up to you to decide. I do not think location matters all that much. I cannot recall why I even opened this issue. Must have effected me somehow :)
Comment 9 Chema Alonso Josa (RETIRED) gentoo-dev 2017-08-04 19:29:40 UTC
I agree with you. Taking a look at /var/lib directory, logrotate.status should reside in a proper directory (misc is ok for me)

I've pushed this change to the last (unstable version) =app-admin/logrotate-3.12.3

Works fine here, please test and reopen if necessary.

Thanks a bunch!
Comment 10 zless 2017-10-02 19:29:09 UTC
/var/lib/misc doesn't exist.

logrotate now will fail with:

error: error creating state file /var/lib/misc/logrotate.status: No such file or directory
error: error opening /var/lib/misc/logrotate.status: No such file or directory

Comment 11 Chema Alonso Josa (RETIRED) gentoo-dev 2017-10-03 12:52:05 UTC
(In reply to Arthur Țițeică from comment #10)
> /var/lib/misc doesn't exist.
> ... 
> app-admin/logrotate-3.12.3-r1

/var/lib/misc gets created by /etc/init.d/bootmisc script at boottime.

Can you check if this is script is running?

Comment 12 zless 2017-10-03 13:50:03 UTC
I'm on systemd. Maybe this needs an entry in '/usr/lib/tmpfiles.d/'.
Comment 13 Chema Alonso Josa (RETIRED) gentoo-dev 2017-10-04 20:49:42 UTC
Fixed in app-admin/logrotate-3.12.3-r2.

Please test.
Comment 14 zless 2017-10-05 08:06:31 UTC
Looks fine to me.

On a running system one needs to manually run

    systemd-tmpfiles --create /usr/lib/tmpfiles.d/logrotate.conf

I'm not sure if this needs a post-install message or not. I haven't seen any other packages doing this but it's causing problems at times.
Comment 15 Chema Alonso Josa (RETIRED) gentoo-dev 2017-10-05 20:47:13 UTC
Message added. Thanks.
Comment 16 gen2dev 2018-02-26 13:50:50 UTC
I'm getting "denied" events in the audit log because now logrotate is putting the status file in /var/log/misc/ but the policy still has it in /var/lib/.
  /var/lib/logrotate(/.*)?      system_u:object_r:logrotate_var_lib_t
  /var/lib/logrotate\.status    --      system_u:object_r:logrotate_var_lib_t

Comment 17 gen2dev 2018-02-26 13:57:10 UTC
I submitted bug 648844 against SElinux to get the policy updated.
Comment 18 Larry the Git Cow gentoo-dev 2021-07-30 08:39:47 UTC
The bug has been referenced in the following commit(s):

commit f30f1d471181f5b487dda53ac4d112cf56627060
Author:     Georgy Yakovlev <>
AuthorDate: 2021-07-30 08:33:46 +0000
Commit:     Georgy Yakovlev <>
CommitDate: 2021-07-30 08:34:54 +0000

    app-admin/logrotate: call tmpfiles_process
    instead of printing message
    on openrc systems that directory already created by bootmisc
    Signed-off-by: Georgy Yakovlev <>

 app-admin/logrotate/logrotate-3.18.1.ebuild | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)