Bug 20821 - logrotate mails gzipped logs
logrotate mails gzipped logs
Status: CLOSED WORKSFORME
Product: Red Hat Linux
Classification: Retired
Component: logrotate (Show other bugs)
7.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Preston Brown
David Lawrence
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2000-11-14 02:15 EST by Need Real Name
Modified: 2007-04-18 12:29 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2001-06-21 15:46:50 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Need Real Name 2000-11-14 02:15:28 EST
logrotate-3.5.2-1 mails gzipped logs (binary data as mail text) if compress
and delaycompress set, but mail first not set.

/etc/logrotate.conf:
compress
delaycompress
mail be@berdmann.de

--> leads to this mail

Return-path: <root@berdmann.de>
Envelope-to: be@berdmann.de
Delivery-date: Sun, 12 Nov 2000 04:02:37 +0100
Received: from root by ente.berdmann.de with local (Exim 3.16 #2)
        id 13unPg-0007Wz-00
        for be@berdmann.de; Sun, 12 Nov 2000 04:02:36 +0100
To: be@berdmann.de
Subject: /var/log/httpd/access_log.5.gz
Message-Id: <E13unPg-0007Wz-00@ente.berdmann.de>
From: root <root@berdmann.de>
Date: Sun, 12 Nov 2000 04:02:36 +0100

<6i9access_log.1


This didn't happen with logrotate-3.3.2.


I tracked it down to line 513 in logrotate.c (from 3.5.2):

		    if ((log->flags & LOG_FLAG_COMPRESS) &&
			    !(log->flags & LOG_FLAG_DELAYCOMPRESS) &&
			    (log->flags & LOG_FLAG_MAILFIRST))
			sprintf(command, "%s < %s | %s '%s' %s", 
				    UNCOMPRESS_PIPE, mailFilename, mailCommand,
				    log->files[logNum],
				    log->logAddress);
		    else
			sprintf(command, "%s '%s' %s < %s", mailCommand, 
				    mailFilename, log->logAddress, mailFilename);



In 3.3.2 this part reads as follows (line 500):

		    if (log->flags & LOG_FLAG_COMPRESS)
			sprintf(command, "%s < %s | %s '%s' %s", 
				    UNCOMPRESS_PIPE, mailFilename, mailCommand,
				    log->files[logNum],
				    log->logAddress);
		    else
			sprintf(command, "%s '%s' %s < %s", mailCommand, 
				    mailFilename, log->logAddress, mailFilename);
Comment 1 Preston Brown 2001-06-21 15:46:33 EDT
this would seem to mean that delaycompress wasn't working.  mailfirst is supposed to 
mail the just rotated log, and the just rotated log shouldn't be compressed if 
delaycompress is in use.

Is delaycompress working for you?
Comment 2 Preston Brown 2001-08-06 13:46:54 EDT
closed due to lack of additional feedback.

Note You need to log in before you can comment on or make changes to this bug.