Debian Bug report logs - #582630
logrotate fails on missing logfiles even when it shouldn't

version graph

Package: logrotate; Maintainer for logrotate is Paul Martin <pm@debian.org>; Source for logrotate is src:logrotate.

Reported by: Holger Levsen <holger@layer-acht.org>

Date: Sat, 22 May 2010 09:45:05 UTC

Severity: normal

Tags: upstream

Merged with 588515

Found in version logrotate/3.7.8-6

Blocking fix for 604807: piuparts.debian.org: remove --skip-logrotatefiles-test from piuparts.conf

Reply or subscribe to this bug.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, 566597@bugs.debian.org, evgeni@debian.org, Paul Martin <pm@debian.org>:
Bug#582630; Package logrotate. (Sat, 22 May 2010 09:45:08 GMT) Full text and rfc822 format available.

Acknowledgement sent to Holger Levsen <holger@layer-acht.org>:
New Bug report received and forwarded. Copy sent to 566597@bugs.debian.org, evgeni@debian.org, Paul Martin <pm@debian.org>. (Sat, 22 May 2010 09:45:08 GMT) Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: Holger Levsen <holger@layer-acht.org>
To: submit@bugs.debian.org
Subject: logrotate fails on missing logfiles even when it shouldn't
Date: Sat, 22 May 2010 11:42:07 +0200
[Message part 1 (text/plain, inline)]
package: logrotate
version: 3.7.8-6
x-debbugs-cc: 566597@bugs.debian.org, evgeni@debian.org

Hi,

piuparts.debian.org since some time tests for failing logrotate runs of 
packages, the results are at 
http://piuparts.debian.org/sid/logrotate_error_after_removal_error.html

Looking at http://piuparts.debian.org/sid/fail/munge_0.5.9-2.log the relevant 
lines are:

0m10.8s DEBUG: Starting command: 
['chroot', '/org/piuparts.debian.org/tmp/tmpk8ojpT', '/usr/sbin/logrotate', '/etc/logrotate.d/munge']
0m10.8s DUMP: 
  error: error accessing /var/log/munge: No such file or directory
  error: /etc/logrotate.d/munge:1 glob failed for /var/log/munge/*.log
  error: found error in /var/log/munge/*.log , skipping

Now let's look at munges logrotate file:

$ cat /etc/logrotate.d/munge 
/var/log/munge/*.log {
  rotate 12
  weekly
  compress
  missingok
  postrotate
      /usr/sbin/invoke-rc.d --quiet munge force-reload >/dev/null
  endscript
}

So when piuparts tests the package it doesn't run munge (in this example) and 
thus /var/log/munge/ never gets created... 

I have come to think this is a bug in logrotate as the config file 
specifies "missingok" and the log file is missing. Do you agree?


cheers,
	Holger
[signature.asc (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org:
Bug#582630; Package logrotate. (Sat, 22 May 2010 10:39:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Paul Martin <pm@debian.org>:
Extra info received and forwarded to list. (Sat, 22 May 2010 10:39:04 GMT) Full text and rfc822 format available.

Message #10 received at 582630@bugs.debian.org (full text, mbox):

From: Paul Martin <pm@debian.org>
To: Holger Levsen <holger@layer-acht.org>, 582630@bugs.debian.org
Subject: Re: Bug#582630: logrotate fails on missing logfiles even when it shouldn't
Date: Sat, 22 May 2010 11:09:13 +0100
[Message part 1 (text/plain, inline)]
On Sat, May 22, 2010 at 11:42:07AM +0200, Holger Levsen wrote:

> piuparts.debian.org since some time tests for failing logrotate runs of 
> packages, the results are at 
> http://piuparts.debian.org/sid/logrotate_error_after_removal_error.html

These error messages are correct. Logrotate is complaining that the
directory is missing, not that the files are missing. Logrotate
doesn't fail in this situation (even though it shouldn't occur with
correctly installed packages that have had time to accumulate logs),
but complains on stderr. A message on stderr is not a sign of the
failure of logrotate.

The correct thing to do in this situation is to purge the package
concerned, not just remove it.

-- 
Paul Martin <pm@debian.org>
[signature.asc (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, Paul Martin <pm@debian.org>:
Bug#582630; Package logrotate. (Sat, 22 May 2010 11:33:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Holger Levsen <holger@layer-acht.org>:
Extra info received and forwarded to list. Copy sent to Paul Martin <pm@debian.org>. (Sat, 22 May 2010 11:33:03 GMT) Full text and rfc822 format available.

Message #15 received at 582630@bugs.debian.org (full text, mbox):

From: Holger Levsen <holger@layer-acht.org>
To: 582630@bugs.debian.org, 582630-subscribe@bugs.debian.org
Subject: Re: Bug#582630: logrotate fails on missing logfiles even when it shouldn't
Date: Sat, 22 May 2010 13:28:39 +0200
[Message part 1 (text/plain, inline)]
Hi Paul,

On Samstag, 22. Mai 2010, Paul Martin wrote:
> These error messages are correct. Logrotate is complaining that the
> directory is missing, not that the files are missing. Logrotate
> doesn't fail in this situation (even though it shouldn't occur with
> correctly installed packages that have had time to accumulate logs),
> but complains on stderr. A message on stderr is not a sign of the
> failure of logrotate.

True, but wouldnt it be nicer if logrotate intercepted that error and thus 
surpresses the message? The logrotate config file used says its ok if the log 
is missing, so IMHO it should be ok too, if the directory is missing.

> The correct thing to do in this situation is to purge the package
> concerned, not just remove it.

I consider this to be a workaround. A removed package should not generate 
noise.

As it is, I consider removing this piuparts test alltogether, which I think 
would be sad, as the test can catch other, more severe problems.


cheers,
	Holger

[signature.asc (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org:
Bug#582630; Package logrotate. (Sat, 22 May 2010 11:45:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Paul Martin <pm@debian.org>:
Extra info received and forwarded to list. (Sat, 22 May 2010 11:45:03 GMT) Full text and rfc822 format available.

Message #20 received at 582630@bugs.debian.org (full text, mbox):

From: Paul Martin <pm@debian.org>
To: Holger Levsen <holger@layer-acht.org>, 582630@bugs.debian.org
Subject: Re: Bug#582630: logrotate fails on missing logfiles even when it shouldn't
Date: Sat, 22 May 2010 12:42:23 +0100
[Message part 1 (text/plain, inline)]
On Sat, May 22, 2010 at 01:28:39PM +0200, Holger Levsen wrote:

> True, but wouldnt it be nicer if logrotate intercepted that error and thus 
> surpresses the message? The logrotate config file used says its ok if the log 
> is missing, so IMHO it should be ok too, if the directory is missing.

logrotate wasn't written with Debian in mind. It's a RedHat program.

The only way to fix this properly would be for logrotate to have the
same sort of logic as an init.d script -- ie. checking for a nominated
binary to exist.

-- 
Paul Martin <pm@debian.org>
[signature.asc (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, Paul Martin <pm@debian.org>:
Bug#582630; Package logrotate. (Sat, 22 May 2010 11:54:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Holger Levsen <holger@layer-acht.org>:
Extra info received and forwarded to list. Copy sent to Paul Martin <pm@debian.org>. (Sat, 22 May 2010 11:54:03 GMT) Full text and rfc822 format available.

Message #25 received at 582630@bugs.debian.org (full text, mbox):

From: Holger Levsen <holger@layer-acht.org>
To: control@bugs.debian.org
Cc: 582630@bugs.debian.org
Subject: Re: Bug#582630: logrotate fails on missing logfiles even when it shouldn't
Date: Sat, 22 May 2010 13:50:56 +0200
[Message part 1 (text/plain, inline)]
tags 582630 + upstream
thanks

Hi,

On Samstag, 22. Mai 2010, Paul Martin wrote:
> On Sat, May 22, 2010 at 01:28:39PM +0200, Holger Levsen wrote:
> > True, but wouldnt it be nicer if logrotate intercepted that error and
> > thus surpresses the message? The logrotate config file used says its ok
> > if the log is missing, so IMHO it should be ok too, if the directory is
> > missing.
> logrotate wasn't written with Debian in mind. It's a RedHat program.

I fail to see how this is relevant. 

> The only way to fix this properly would be for logrotate to have the
> same sort of logic as an init.d script -- ie. checking for a nominated
> binary to exist.

Yes, but that should be trivial, or? And yes, of course this is an upstream 
bug.


cheers,
	Holger
[signature.asc (application/pgp-signature, inline)]

Added tag(s) upstream. Request was from Holger Levsen <holger@layer-acht.org> to control@bugs.debian.org. (Sat, 22 May 2010 11:54:05 GMT) Full text and rfc822 format available.

Merged 582630 588515. Request was from Paul Martin <pm@debian.org> to control@bugs.debian.org. (Fri, 09 Jul 2010 10:51:09 GMT) Full text and rfc822 format available.

Added indication that bug 582630 blocks 604807 Request was from Holger Levsen <holger@layer-acht.org> to control@bugs.debian.org. (Wed, 24 Nov 2010 17:12:14 GMT) Full text and rfc822 format available.

Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Fri Apr 18 14:25:47 2014; Machine Name: buxtehude.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.