Mailinglist Archive: opensuse (769 mails)

< Previous Next >
Re: [opensuse] logrotate not rotating my logs (openSUSE 13.2)
On Fri, May 20, 2016 at 4:58 PM, Patrick Shanahan <paka@xxxxxxxxxxxx> wrote:
* Greg Freemyer <greg.freemyer@xxxxxxxxx> [05-20-16 16:48]:
On Fri, May 20, 2016 at 4:28 PM, Patrick Shanahan <paka@xxxxxxxxxxxx> wrote:
* Greg Freemyer <greg.freemyer@xxxxxxxxx> [05-20-16 16:19]:
My last rotated logs on this server are from 20160305

===
rpm -qa | grep log
syslog-service-2.0-778.3.1.noarch
rsyslog-8.4.2-3.1.x86_64
logrotate-3.8.7-6.1.2.x86_64
klogd-1.4.1-778.3.1.x86_64
liblogging0-1.0.4-2.1.3.x86_64
zypper-log-1.11.54-40.2.noarch
perl-Unix-Syslog-1.1-19.1.3.x86_64
===

Not sure how to troubleshoot this, so I'll wait for questions.

Logrotate maintains scripts:
/etc/logrotate.d/
called via cron: /etc/logrotate.conf

also
systemctl status logrotate

note that an unreadable log-file can cause rotation to fail. Not likely
your problem unless you have a rotating rust problem :(


Strange:

systemctl status logrotate
logrotate.service - Rotate log files
Loaded: loaded (/usr/lib/systemd/system/logrotate.service; static)
Active: inactive (dead)
Docs: man:logrotate(8)
man:logrotate.conf(5)

So the systemd service isn't running. But when I try to enable it:

==================================
sudo systemctl enable logrotate
root's password:
The unit files have no [Install] section. They are not meant to be enabled
using systemctl.
Possible reasons for having this kind of units are:
1) A unit may be statically enabled by being symlinked from another unit's
.wants/ or .requires/ directory.
2) A unit's purpose may be to act as a helper for some other unit which has
a requirement dependency on it.
3) A unit may be started when needed via activation (socket, path, timer,
D-Bus, udev, scripted systemctl call, ...).
===================================

Is it not supposed to be enabled?

Also, I did a " sudo systemctl start logrotate" and my logs are being
compressed now, but that won't survive a reboot.

Guess logrotate rpm doesn't contain the "service" files ?? or they didn't
get installed properly: /usr/lib/systemd/system/logrotate.service


Hmm....The service file says its a oneshot service. There is a
logrotate.timer file.

The problem must be that the timer isn't triggering. (Remember I can
run it manually).

=========================
sudo cat logrotate.timer
[Unit]
Description=Daily rotation of log files
Documentation=man:logrotate(8) man:logrotate.conf(5)

[Timer]
OnCalendar=daily
AccuracySec=12h
# not supported by our systemd (210) yet
#Persistent=true

[Install]
WantedBy=timers.target

=========================
cat logrotate.service
[Unit]
Description=Rotate log files
Documentation=man:logrotate(8) man:logrotate.conf(5)
ConditionACPower=true

[Service]
Type=oneshot
ExecStart=/usr/sbin/logrotate /etc/logrotate.conf
Nice=19
IOSchedulingClass=best-effort
IOSchedulingPriority=7
=========================

Greg
--
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse+owner@xxxxxxxxxxxx

< Previous Next >
Follow Ups