"Cannot add dependency job for unit logrotate.timer" in journal


I am getting this in journal:

Nov 28 16:59:16 i7 systemd[1]: Cannot add dependency job for unit logrotate.timer, ignoring: Unit logrotate.timer failed to load: No such file or directory.

Is there a real problem and how do I fix it if yes?

Leap has no logrotate systemd services (it’s handled by cron). Was this an upgrade or a fresh install?

Can you post the output from;

cat /etc/os-release
systemctl status logrotate.service
ls /usr/lib/systemd/system/log*

This system is upgraded from 13.2 x64 to Leap 42.1

# cat /etc/os-release                                                                                                                         
NAME="openSUSE Leap"                                                                                                                               
PRETTY_NAME="openSUSE Leap 42.1 (x86_64)"                                                                                                          

# systemctl status logrotate.service                              
   Loaded: not-found (Reason: No such file or directory)               
   Active: inactive (dead)                                             
# ls /usr/lib/systemd/system/log*                                 
ls: cannot access /usr/lib/systemd/system/log*: No such file or directory

What should I do?

So an upgrade reminant lurking somewhere… I would raise a bug;




Also watching, it appeared to be a duplicate of Bug 954375, so wonder which of below (in bold) solutions best, though as appears not causing other problems, chose patience ?-)

[Bug 954375] New: package logrotate is missing logrotate.service, logrotate.timer
From: bugzilla_noreply@xxxxxxxxxx
Date: Tue, 10 Nov 2015 02:12:15 +0000
Message-id: <bug-954375-21960@http.bugzilla.opensuse.org/>

Package logrotate in Version 3.8.7-7.1 is missing the files:

These were present as of opensuse 13.2 .

The file logrotate.timer is required by the line:
enable logrotate.timer
in file /usr/lib/systemd/system-preset/90-default-openSUSE.preset of
systemd-presets-branding-openSUSE-0.3.0-23.2.noarch .

Instead it is called via /etc/cron.daily/logrotate .

I guess this change (among others) from Changes is missing:"

  • Migrate from cron to systemd timer units, this is overall
    the most important package to migrate since it is one
    of the very few base components that hard-require cron."

**The package from Leap should be updated to latest in 13.2 (or)
“enable logrotate.timer” should be removed from
/usr/lib/systemd/system-preset/90-default-openSUSE.preset **.


Looking at this, I don’t think either suggested option is likely to satisfy your objective.
The first option is to merely copy the logrotate.timer.service Unit file from 13.2 to LEAP… but… that won’t provide a working logrotate(see below).
The second option appears to merely resolve the error but will not give you a working logrotate.

On one of my LEAP (not upgraded), it doesn’t have a logrotate.timer.service Unit file.
It should be noted that the logrotate.timer.service file on my 13.2 has an embedded comment that the timer is not working properly on systemd 210 (both LEAP and 13.2 are on that version), although I’m mystified why because it would seem to me <very> trivial to hook up this timer file to anything that is currently a cron script.

So, it appears for now the most certain path to success would be as Malcom suggests, to set up your logrotate as cron scripts (although I would certainly also suggest that someone should see whether invoking logrotate from one of the systemd timer services).