Bug#825776: logrotate: Sometimes files are skipped during weekly rotation.

2017-02-12 Thread Doug Smythies
The now upstream committed solution to this issue
( https://github.com/logrotate/logrotate/issues/93 )
does not change the default way logrotate worked in the past.
So now it just has to make its way downstream.
 



Bug#825776: logrotate: Sometimes files are skipped during weekly rotation.

2017-01-09 Thread Doug Smythies
On Mon, 12 Dec 2016 17:48:06 -0800 "Doug Smythies"  wrote: 
> The related logrotate GitHub upstream bug report is issue number 93: 
> https://github.com/logrotate/logrotate/issues/93 
> I have referenced this bug report there.

The proposed upstream solution for this issue will also fundamentally
change how weekly log rotation works. Specifically, it will eliminate
the "log files are rotated if the current weekday is less than the
weekday of the last rotation" condition. 

Please chime in on the upstream issue report and object.



Bug#825776: logrotate: Sometimes files are skipped during weekly rotation.

2016-12-12 Thread Doug Smythies
The related logrotate GitHub upstream bug report is issue number 93:
https://github.com/logrotate/logrotate/issues/93
I have referenced this bug report there.



Bug#825776: logrotate: Sometimes files are skipped during weekly rotation.

2016-12-11 Thread Doug Smythies
As of 16.04, Ubuntu has this same problem, where sometimes the weekly rotations 
do not occur until Monday. I have 43 weeks worth of
data with 17 of those weeks incorrectly rotating on Monday.

I have entered an Ubuntu launchpad bug report referring to this bug report.
(https://bugs.launchpad.net/ubuntu/+source/logrotate/+bug/1649168 )

 

If it were up to me, I would make the jitter margin even more than 60 seconds, 
more like 10 minutes (without a lot of thought on the
matter).

 



Bug#825776: logrotate: Sometimes files are skipped during weekly rotation.

2016-05-29 Thread Kees Theunissen
Package: logrotate
Version: 3.8.7-1+b1
Severity: normal
Tags: upstream patch

Dear Maintainer,

Sometimes files are not rotated during weekly logrotation, despite of
the fact that the last rotation was a week ago (within a few seconds).
This bugs seems to be introduced in Debian Jessie.

Debian Wheezy stored only the date of the last rotation in the
logrotate status file (/var/lib/logrotate/status) like:
  "/var/log/syslog" 2016-5-29
The "hour", "minutes" and "seconds" were initialized as 0 when the
status file was read. This pins the timestamp of the last rotation
effectively at 12:00:00 AM.

Debian Jessie stores the full date and time:
  "/var/log/syslog" 2016-5-29-6:25:4
and checks for weekly rotation if the last rotation was more than
(7 * 24 * 3600) seconds ago.
This check fails occasionally due to some jitter in the exact moment
that logrotate is started.

The patch below should fix this. (untested)

$ diff -u logrotate.c.original logrotate.c
--- logrotate.c.original2016-05-29 17:32:06.954792359 +0200
+++ logrotate.c 2016-05-29 17:39:56.674758835 +0200
@@ -856,12 +856,13 @@
   1) the current weekday is before the weekday of the
   last rotation
   2) more then a week has passed since the last
-  rotation */
+  rotation. Allow some jitter in the time - 60 seconds
+  should be sufficient and harmless. */
state->doRotate = ((now.tm_wday < state->lastRotated.tm_wday)
   ||
   ((mktime() -
 mktime(>lastRotated)) >
-   (7 * 24 * 3600)));
+   (7 * 24 * 3600 - 60)));
break;
case ROT_HOURLY:
state->doRotate = ((now.tm_hour != state->lastRotated.tm_hour) ||



Regards,

Kees Theunissen.



-- Package-specific info:
Contents of /etc/logrotate.d
total 32
-rw-r--r-- 1 root root 173 Apr 13  2015 apt
-rw-r--r-- 1 root root  79 Nov  8  2014 aptitude
-rw-r--r-- 1 root root 382 Mar 10 05:06 clamav-daemon
-rw-r--r-- 1 root root 409 Mar 10 05:06 clamav-freshclam
-rw-r--r-- 1 root root 139 Jan 15  2014 clamav-unofficial-sigs
-rw-r--r-- 1 root root 232 Apr 10  2015 dpkg
-rw-r--r-- 1 root root 140 Oct 16  2014 mimedefang
-rw-r--r-- 1 root root 515 Oct  2  2014 rsyslog


-- System Information:
Debian Release: 8.4
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 3.16.0-4-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages logrotate depends on:
ii  base-passwd 3.5.37
ii  cron [cron-daemon]  3.0pl1-127+deb8u1
ii  libacl1 2.2.52-2
ii  libc6   2.19-18+deb8u4
ii  libpopt01.16-10
ii  libselinux1 2.3-2

Versions of packages logrotate recommends:
ii  bsd-mailx [mailx]  8.1.2-0.20141216cvs-2

logrotate suggests no packages.

-- no debconf information