Directory /var/log/libvirt/qemu missing in package

Bug #886770 reported by Hadmut Danisch
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
libvirt (Debian)
Fix Released
Unknown
libvirt (Ubuntu)
Fix Released
Low
Unassigned

Bug Description

Hi,

libvirt-bin comes with a /etc/logrotate.d/libvirtd that tries to logrotate log files in /var/log/libvirt/qemu , but the libvirt-bin package contains only /var/log/libvirt and not /var/log/libvirt/qemu. If that directory is absent (i.e. when not made manually), the logrotate cronjob generates an error message at every run:

/etc/cron.daily/logrotate:
error: error accessing /var/log/libvirt/qemu: No such file or directory
error: libvirtd:1 glob failed for /var/log/libvirt/qemu/*.log
error: found error in /var/log/libvirt/qemu/*.log , skipping

If a logrotate accesses a directory, this directory must exist. Therefore, please add that directory to the package (even if empty) to avoid thus error messages. It is not just an error message. It is an error.

regards

ProblemType: Bug
DistroRelease: Ubuntu 11.10
Package: libvirt-bin (not installed)
ProcVersionSignature: Ubuntu 3.0.0-13.21-generic 3.0.6
Uname: Linux 3.0.0-13-generic x86_64
ApportVersion: 1.23-0ubuntu4
Architecture: amd64
Date: Sun Nov 6 10:25:41 2011
EcryptfsInUse: Yes
InstallationMedia: Ubuntu 10.04 LTS "Lucid Lynx" - Release amd64 (20100427.1)
ProcEnviron:
 LANGUAGE=en_US:de_DE:en
 PATH=(custom, user)
 LANG=de_DE.UTF-8
 LC_MESSAGES=en_US.UTF-8
 SHELL=/bin/tcsh
SourcePackage: libvirt
UpgradeStatus: Upgraded to oneiric on 2011-10-29 (7 days ago)

Related branches

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Thanks for taking the time to report this bug.

The libvirt-bin package does, during install, create the /var/log/libvirt/qemu directory. Can you show us the result of running

   dpkg -l | grep libvirt
   cat /etc/*release

and tell us when and how you installed libvirt?

Changed in libvirt (Ubuntu):
importance: Undecided → Low
status: New → Incomplete
Revision history for this message
Hadmut Danisch (hadmut) wrote :

% dpkg -l | grep libvirt
rc libvirt-bin 0.8.8-1ubuntu6.6 the programs for the libvirt library
ii libvirt0 0.9.2-4ubuntu15.1 library for interfacing with different virtualization systems
ii libvirtodbc0 6.1.3+dfsg1-1ubuntu1 high-performance database - ODBC libraries
ii python-libvirt 0.9.2-4ubuntu15.1

% cat /etc/*release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=11.10
DISTRIB_CODENAME=oneiric
DISTRIB_DESCRIPTION="Ubuntu 11.10"

 I've installed the package - don't know - about 1-2 years ago. recently upgraded to oneiric.

I currently do not see how libvirt-bin could create that directory during install, because there is no postinst script. Just a .postrm .

(The upgrade-procedure failed and aborted, because the package downloading the flash plugin for the browser tried to download the flash plugin at a system state where the network configuration was down and exited with a exit value >0. Thus the upgrader natty->oneiric aborted. I then had to finish things manually. Maybe this has influenced things somehow. (but all packages were definitely configured.))

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

The directory is created with debian/libvirt-bin.dirs, and shows up in 'dpkg -L libvirt-bin'.

Could you try re-installing libvirt-bin and see if that fixes your problem?

It would be a real bug if 'apt-get remove libvirt-bin' removed /var/log/libvirt/qemu but not the libvirt logrotate rules. I'll test to see if that is the case. But it sounds just as likely that this really was a side effect of the bad upgrade which would not happen with a simple 'apt-get remove'.

Changed in libvirt (Ubuntu):
status: Incomplete → New
Changed in libvirt (Ubuntu):
status: New → Confirmed
Revision history for this message
Hadmut Danisch (hadmut) wrote :

Oh, yep, the package was actually deinstalled, but not purged. Didn't notice that, must have been removed somewhere in the broken upgrade process. Thus the directory was gone, while /var/log/libvirt and /var/log/libvirt/shutdownlog.log remained on the system, as well as /etc/logrotate.d/libvirtd (and probably all other files in /etc).

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Indeed, because /var/log/libvirt/qemu gets created by libvirt-bin.dirs, if there is no log output under /var/log/libvirt/qemu, then when doing apt-get remove libvirt-bin, the logrotate.d/libvirt file is not deleted (until you purge), but the /var/log/libvirt/qemu dir is.

This should get moved to postinst as suggested by Hadmut.

Hadmut, I will file a bug against debian to do so. If you prefer to do so yourself, please let me know.

Revision history for this message
Hadmut Danisch (hadmut) wrote :

Please do. I'll just purge the package.

thanks and regards

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package libvirt - 0.9.6-2ubuntu2

---------------
libvirt (0.9.6-2ubuntu2) precise; urgency=low

  * Move creation of /var/log/libvirt/{lxc,uml,qemu} dirs from libvirt-bin.dirs
    to libvirt-bin.postinst. Otherwise after a 'apt-get remove libvirt-bin',
    that dir will be removed (if empty) but /etc/logrotate.d/libvirtd will
    still try to rotate it and raise errors. (LP: #886770)
  * debian/rules: Fix a bug in the new logic for installing upstream-supplied
    logrotate files. (LP: #887312)
 -- Serge Hallyn <email address hidden> Mon, 07 Nov 2011 12:58:49 -0600

Changed in libvirt (Ubuntu):
status: Confirmed → Fix Released
Changed in libvirt (Debian):
status: Unknown → Fix Released
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.