Bug 1655153 - logrotate should use systemd timer unit instead of cron.daily
Summary: logrotate should use systemd timer unit instead of cron.daily
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: logrotate
Version: 28
Hardware: All
OS: Linux
unspecified
low
Target Milestone: ---
Assignee: Kamil Dudka
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-11-30 19:04 UTC by Theodore Cowan
Modified: 2020-02-13 23:30 UTC (History)
7 users (show)

Fixed In Version: logrotate-3.15.0-1.fc30
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1177286
Environment:
Last Closed: 2018-12-04 15:55:35 UTC


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Bugzilla 1502085 None CLOSED logrotate permission denied under systemd with selinux 2019-10-04 09:45:35 UTC

Internal Links: 1502085

Description Theodore Cowan 2018-11-30 19:04:45 UTC
+++ This bug was initially created as a clone of Bug #1177286 +++

There is no need for logrotate to use cron.daily. The same can be accomplished with a systemd timer unit.

--- Additional comment from Jan Kaluža on 2015-07-23 03:12:45 EDT ---

That would be against Packaging Guidelines:

"""
Packages which do not already depend or require systemd must not use timer units but instead depend and have requirement on crontabs, to avoid introducing unnecessary new dependencies on systemd directly.
"""

Closing as WONTFIX.

--- Additional comment from Theodore Cowan on 2018-11-30 14:03:16 EST ---

It's time to re-evaluate this.  crond isn't even installed on cloud images of Fedora 28+ and systemd is ubiquitous.

logrotate should take on cronie as a dependency or user systemd-timer.

Comment 1 Theodore Cowan 2018-11-30 19:07:34 UTC
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=858021

Debian/Ubuntu has reportedly already made this change.

Comment 2 Kamil Dudka 2018-12-02 20:43:11 UTC
There is currently a pull request under review to address this:

https://src.fedoraproject.org/rpms/logrotate/pull-request/1

Comment 3 Kamil Dudka 2018-12-04 15:55:35 UTC
downstream commit:

https://src.fedoraproject.org/rpms/logrotate/c/dadc24ae

Comment 4 Colin Walters 2020-01-31 15:43:34 UTC
As implemented today, this also means that logrotate isn't enabled on new installs; was that intentional?

Comment 6 Kamil Dudka 2020-01-31 16:13:44 UTC
Yes, it is a trade-off.  logrotate used to unconditionally install the cron hook but it took effect only when cron was actually installed and enabled.  We cannot use this logic with systemd any more because systemd is always installed.  So we made our best to preserve the behavior on updates but the timer is not enabled on fresh Fedora installations now.

Are you suggesting that we enable logrotate timer by default whenever logrotate is installed?

There can be Fedora installations that include logrotate but trigger it by other means (or do not trigger it at all).

In any case, the first chance when we can safely change this is Fedora 32 I am afraid.


Note You need to log in before you can comment on or make changes to this bug.