Bug 908279 - logrotate.timer not enabled automatically
Summary: logrotate.timer not enabled automatically
Status: CONFIRMED
Alias: None
Product: openSUSE Tumbleweed
Classification: openSUSE
Component: Basesystem (show other bugs)
Version: 201411*
Hardware: Other openSUSE 13.2
: P5 - None : Normal (vote)
Target Milestone: ---
Assignee: Marcus Meissner
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-12-03 23:30 UTC by Christian Boltz
Modified: 2018-04-18 08:22 UTC (History)
4 users (show)

See Also:
Found By: Beta-Customer
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Boltz 2014-12-03 23:30:14 UTC
I'm always following Factory, and by luck noticed that I have a >100 MB /var/log/messages which wasn't rotated since months :-/

This seems to be a problem with the switch from a cronjob to logrotate.timer - logrotate.timer was disabled :-(

Please make sure to always enable logrotate.timer (except if explicitely disabled by the user).

Note: I wouldn't be too surprised if systemd-sysv-convert can only handle *.service, but not *.timer.
Comment 1 Marcus Meissner 2014-12-04 10:01:07 UTC
for systemd-presets-brading-opensUSE I guess ?
Comment 2 Marcus Meissner 2014-12-04 10:58:50 UTC
hmm, it has:
enable logrotate.timer

added in
-------------------------------------------------------------------
Wed Apr  2 23:54:58 UTC 2014 - crrodriguez@opensuse.org

- Enable the logrotate.timer that replaces the cron-based
  activation by default.


Did you install fresh? If not, run "systemctl enable logrotate.timer"
Comment 3 Christian Boltz 2014-12-04 13:14:36 UTC
I'm following Factory since years, so no new install. 
I also know how to manually enable logrotate.timer (and already did that after submitting this bugreport).

However the question is why it wasn't enable automatically - my guess is that the migration from the cron.daily script fails. (If in doubt, test by upgrading a 13.1 to 13.2 and check if logrotate.timer is enabled.)
Comment 4 Cristian Rodríguez 2014-12-04 15:13:44 UTC
The timer is enabled by default

grep logrotate 90-default-openSUSE.preset 
enable logrotate.timer

It seems to the problem beign discussed lately in the packaging mailing list about presets  . sometimes this doesn't work. depends on the package installation order.
Comment 5 Christian Boltz 2017-08-03 21:23:45 UTC
Any news on this old bug?

Leap 42.x still has /etc/cron.daily/logrotate, so we might hit the problem again when people update from Leap 42.x to Leap 15 or from SLE 12 to SLE 15.

If in doubt, I'd recommend to add a check for "systemctl is-enabled logrotate.timer" to openQA.
Comment 6 Tomáš Chvátal 2017-08-04 08:28:35 UTC
Assigning to marcus as he is maintainer of the presets.
Comment 7 Christian Wittmer 2017-12-02 15:43:12 UTC
indeed 'logrotate' (logrotate.timer) is disabled when upgrading from 42.2 to 42.3.
noticed this on all my systems I did upgrade.
Anyway the logrotate package switched back to 'cron.daily' setup.
Hence I am going to update the 42.3 logrotate package to latest version to fix this issue ... and having a working 'logrotate' without manual interaction.
Comment 8 Christian Wittmer 2017-12-02 16:29:31 UTC
I interpreted the changelog wrong ...
anyway on all on my upgraded 42.2 to 42.3 systems there is one special package missing:
- systemd-rpm-macros

as mentioned here:
https://bugzilla.opensuse.org/show_bug.cgi?id=1064303#c10

the important %service_add_pre/%service_add_post macros are missing and hence logrotate is not enabled by default.

With systemd-rpm-macros installed also logrotate.timer is enabled by default after install.

Seems there is a missing dependency about 'systemd-rpm-macros' ...
Comment 9 Marcus Meissner 2017-12-15 16:11:37 UTC
shouöld this really be asking Markus Meissner, or should it be me ? ;)
Comment 10 Christian Wittmer 2017-12-16 12:02:58 UTC
it should have been you 8-)
Comment 11 Jean Delvare 2018-04-18 06:42:12 UTC
I have upgraded my Leap system from 42.2 to 42.3 on February 1st, 2018. The last log rotation happened on January 25th. Since then log files are no longer rotated.

$ systemctl status logrotate.timer
● logrotate.timer - Daily rotation of log files
   Loaded: loaded (/usr/lib/systemd/system/logrotate.timer; disabled; vendor preset: enabled)
   Active: inactive (dead)
     Docs: man:logrotate(8)
           man:logrotate.conf(5)

So the bug is still there.

(Clearing needinfo as the bug is assigned to Marcus anyway.)
Comment 12 Jean Delvare 2018-04-18 06:46:41 UTC
I started looking into this after investigating a root partition full situation on my wife's Tumbleweed system. This is a very old installation and logrotate.timer was disabled for her too. Clearly the upgrade path from cron job to systemd timer is broken. My kids' Tuumbleweed systems have been installed more recently and do not suffer from the problem.

I'll fix my wife's system manually but can we do something for all other users affected by the problem? I'm thinking of upgrades of Leap 42.2 to 42.3, but also SLE 12 SP2 to SP3.