Bug 166912 - Logrotate runs compression program even when the -d is given.
Logrotate runs compression program even when the -d is given.
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: logrotate (Show other bugs)
2
All Linux
medium Severity medium
: ---
: ---
Assigned To: Peter Vrabec
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2005-08-27 03:33 EDT by Aleksey Nogin
Modified: 2007-11-30 17:11 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-09-28 08:08:21 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 Aleksey Nogin 2005-08-27 03:33:39 EDT
Consider the following:

% ls -l /tmp/logs/
итого 8
-rw-rw-r--  1 aleksey aleksey 0 Авг 27 00:28 log
-rw-rw-r--  1 aleksey aleksey 0 Авг 27 00:31 log.1

% cat /tmp/foo
/tmp/logs/log {
    rotate 2
    compress
    delaycompress
    compresscmd /usr/bin/bzip2
    uncompresscmd /usr/bin/bunzip2
    compressext .bz2
}

% logrotate -df /tmp/foo
reading config file /tmp/foo
reading config info for /tmp/logs/log
compress_prog is now /usr/bin/bzip2
uncompress_prog is now /usr/bin/bunzip2
compress_ext is now .bz2

Handling 1 logs

rotating pattern: /tmp/logs/log  forced from command line (2 rotations)
empty log files are rotated, old logs are removed
considering log /tmp/logs/log
  log needs rotating
rotating log /tmp/logs/log, log->rotateCount is 2
compressing log with: /usr/bin/bzip2
renaming /tmp/logs/log.2.bz2 to /tmp/logs/log.3.bz2 (rotatecount 2, logstart 1,
i 2),
renaming /tmp/logs/log.1.bz2 to /tmp/logs/log.2.bz2 (rotatecount 2, logstart 1,
i 1),
renaming /tmp/logs/log.0.bz2 to /tmp/logs/log.1.bz2 (rotatecount 2, logstart 1,
i 0),
renaming /tmp/logs/log to /tmp/logs/log.1
removing old log /tmp/logs/log.3.bz2

% ls -l /tmp/logs/
итого 12
-rw-rw-r--  1 aleksey aleksey  0 Авг 27 00:28 log
-rw-rw-r--  1 aleksey aleksey 14 Авг 27 00:32 log.1.bz2

% rpm -q logrotate
logrotate-3.7.1-2

In the scenario above, the log.1 file was compressed. The "-d" option to
logrotate should have prevented that from happening.
Comment 1 Peter Vrabec 2005-09-23 08:26:27 EDT
Fixed version:
http://people.redhat.com/pvrabec/rpms/logrotate-3.7.2-4.src.rpm
Could u check it please, I would like to push this release into devel.
Comment 2 Aleksey Nogin 2005-09-27 04:29:01 EDT
Seems to work correctly, although I have not tested anything other than the
original scenario.

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