fails when you use pbzip2 with compressoptions

Bug #516850 reported by LoOoD
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
logrotate (Ubuntu)
New
Undecided
Unassigned

Bug Description

Binary package hint: logrotate

Description: Ubuntu 8.10
Release: 8.10

apt-cache policy logrotate
logrotate:
  Installed: 3.7.1-5ubuntu1
  Candidate: 3.7.1-5ubuntu1
  Version table:
 *** 3.7.1-5ubuntu1 0
        100 /var/lib/dpkg/status

Also recompiled/packaged logrotate to 3.7.8-4ubuntu1. I also tried upgrading pbzip2 to v1.0.5 to see if that help but did not.

I'm running rails and am trying to setup logrotate to process the rails logs. With this config I added to /etc/logrotate.d/rails:

/home/website/log/*.log {
 compresscmd /usr/bin/pbzip2
 compressoptions -1
 copytruncate
 create
 compress
 compressext .bz2
 missingok
 rotate 3
}

I expect logrotate to run /usr/bin/pbzip2 -1 /vhome/website/log/rails1.log, but looks like the filename is not being passed to pbzip2.

This is the error I see:
rotating log /home/website/log/rails9.log, log->rotateCount is 3
dateext suffix '-20100203'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
renaming /home/website/log/rails9.log.3.bz2 to /home/website/log/rails9.log.4.bz2 (rotatecount 3, logstart 1, i 3),
renaming /home/website/log/rails9.log.2.bz2 to /home/website/log/rails9.log.3.bz2 (rotatecount 3, logstart 1, i 2),
renaming /home/website/log/rails9.log.1.bz2 to /home/website/log/rails9.log.2.bz2 (rotatecount 3, logstart 1, i 1),
renaming /home/website/log/rails9.log.0.bz2 to /home/website/log/rails9.log.1.bz2 (rotatecount 3, logstart 1, i 0),
old log /home/website/log/rails9.log.0.bz2 does not exist
copying /home/website/log/rails9.log to /home/website/log/rails9.log.1
truncating /home/website/log/rails9.log
compressing log with: /usr/bin/pbzip2
Parallel BZIP2 v1.0.5 - by: Jeff Gilchrist [http://compression.ca]
[Jan. 08, 2009] (uses libbzip2 by Julian Seward)

Invalid command line: Not enough files given. Aborting...

Usage: /usr/bin/pbzip2 [-1 .. -9] [-b#cdfhklp#qrtVz] <filename> <filename2> <filenameN>
 -b# : where # is the file block size in 100k (default 9 = 900k)
 -c : output to standard out (stdout)
 -d : decompress file
 -f : force, overwrite existing output file
 -h : print this help message
 -k : keep input file, don't delete
 -l : load average determines max number processors to use
 -p# : where # is the number of processors (default: autodetect [8])
 -q : quiet mode (default)
 -r : read entire input file into RAM and split between processors
 -t : test compressed file integrity
 -v : verbose mode
 -V : display version info for pbzip2 then exit
 -z : compress file (default)
 -1 .. -9 : set BWT block size to 100k .. 900k (default 900k)

Example: pbzip2 -b15vk myfile.tar
Example: pbzip2 -p4 -r -5 myfile.tar second*.txt
Example: tar cf myfile.tar.bz2 --use-compress-prog=pbzip2 dir_to_compress/
Example: pbzip2 -d myfile.tar.bz2

error: failed to compress log /home/website/log/rails9.log.1

Revision history for this message
Jeff Gilchrist (jeff-gilchrist) wrote :

This is known bug in pbzip2 that does not allow command line options to be used when compressing from stdin. This has been fixed in the upstream beta and should be released as a new version in a week or two.

LoOoD: If you want to e-mail me, I can send you the pbzip2 beta source code to confirm that the fix also resolves this issue.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.