logrotate does not use .xz extension for xz-compressed logs

Bug #1472834 reported by James Wilson
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
logrotate (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

I had an entry in /etc/logrotate.d declared like:

 compress
 compresscmd /usr/bin/xz
 uncompresscmd /usr/bin/unxz

According to man 5 logrotate.conf, the default extension for compressed files ought to be whatever the compresscmd outputs

      compressext
              Specifies which extension to use on compressed logfiles, if compression is enabled. The default follows that of the con‐
              figured compression command.

However, my logs are .gz files, even though when I do run "file" on them , it says "XZ compressed data"

ProblemType: Bug
DistroRelease: Ubuntu 15.04
Package: logrotate 3.8.7-1ubuntu1
ProcVersionSignature: Ubuntu 3.19.0-22.22-generic 3.19.8-ckt1
Uname: Linux 3.19.0-22-generic x86_64
ApportVersion: 2.17.2-0ubuntu1.1
Architecture: amd64
CurrentDesktop: Unity
Date: Wed Jul 8 18:35:41 2015
InstallationDate: Installed on 2015-03-20 (110 days ago)
InstallationMedia: Ubuntu 15.04 "Vivid Vervet" - Alpha amd64 (20150320)
SourcePackage: logrotate
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
James Wilson (jmwilson) wrote :
Anthony Fok (foka)
Changed in logrotate (Ubuntu):
status: New → Confirmed
Revision history for this message
Anthony Fok (foka) wrote :

If I am reading the logrotate 3.8.7 source code correctly, there is no mapping table between compresscmd and compressext, and a search for "xz", "bz" and "lzma" returns no result either.

Indeed, the only compression program that logrotate 3.8.7 knows about is gzip, and if compressext isn't defined in the config files, the default COMPRESS_EXT ".gz" is used instead. There is currently no "smart logic" to set the correct compressext automatically from compresscmd.

Perhaps this bug is best reported at logrotate's new home on GitHub at https://github.com/logrotate/logrotate. AFAICT, the bug still exists in the latest logrotate 3.9.2.

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.