Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 598163 - libvirtd should delete its UNIX domain sockets upon daemon shutdown
Summary: libvirtd should delete its UNIX domain sockets upon daemon shutdown
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt
Version: 6.0
Hardware: All
OS: Linux
Target Milestone: rc
: ---
Assignee: Daniel Berrange
QA Contact: Virtualization Bugs
Depends On:
TreeView+ depends on / blocked
Reported: 2010-05-31 15:56 UTC by Michael S. Tsirkin
Modified: 2010-11-11 14:48 UTC (History)
8 users (show)

Fixed In Version: libvirt-0_8_1-8_el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2010-11-11 14:48:32 UTC
Target Upstream Version:

Attachments (Terms of Use)
Remove UNIX sockets on shutdown (deleted)
2010-06-03 13:43 UTC, Daniel Berrange
no flags Details | Diff

Description Michael S. Tsirkin 2010-05-31 15:56:20 UTC
Description of problem:
installed libvirt which installed libvirtd but
did not start it. had to reboot to get it started

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. yum install libvirt
2. ls -l /var/run/libvirt/libvirt-sock
3. /etc/rc.d/init.d/libvirtd start
3. yum remove libvirt
4. ls -l /var/run/libvirt/libvirt-sock
Actual results:
after install libvirtd is not running and libvirt sock does not exist
after remove libvirtd is sill running and sock is left behind

Expected results:
libvirtd should run after install, reboot should not be required
after remove, should stop libvirtd and remove the sock file, do not leave files behind

Additional info:

Comment 2 Cole Robinson 2010-06-01 17:44:38 UTC
Pretty sure your startup suggestion would violate packaging guidelines:

As for uninstall, we don't take down qemu-kvm processes when uninstalling that package, why should we stop libvirtd when uninstalling it?

Comment 3 Daniel Berrange 2010-06-02 10:25:19 UTC
We already stop the daemon during uninstall:

%if %{with_libvirtd}
if [ $1 = 0 ]; then
    /sbin/service libvirtd stop 1>/dev/null 2>&1
    /sbin/chkconfig --del libvirtd

And I've verified that it works

# ps -axuwfw | grep libvirtd
root      6519  0.0  2.7 620236 21688 ?        Sl   Jun01   0:01 libvirtd --daemon

# rpm -e libvirt
warning: /etc/libvirt/qemu.conf saved as /etc/libvirt/qemu.conf.rpmsave
warning: /etc/libvirt/libvirtd.conf saved as /etc/libvirt/libvirtd.conf.rpmsave

# ps -axuwfw | grep libvirtd

As Cole says, starting the daemon upon install is forbidden by packaging rules.

Comment 4 Michael S. Tsirkin 2010-06-02 11:27:05 UTC
why is  /var/run/libvirt/libvirt-sock left behind then?
Is libvirtd daemon removing it on stop?

Comment 5 Daniel Berrange 2010-06-03 13:43:54 UTC
Created attachment 419370 [details]
Remove UNIX sockets on shutdown

Comment 7 Dave Allan 2010-06-10 21:31:45 UTC
libvirt-0_8_1-8_el6 has been built in RHEL-6-candidate with the fix.


Comment 9 zhanghaiyan 2010-07-06 03:21:17 UTC
Verified this bug PASS with libvirt-0.8.1-13.el6.x86_64
- kernel-2.6.32-42.el6.x86_64
- qemu-kvm-
- qemu-img-

1. As Cole says, starting the daemon upon install is forbidden by packaging rules. So after new install libvirt package, the libvirtd service is stop status and /var/run/libvirt/libvirt-sock is not generated.

2. After remove libvirt package, libvirtd service is stoped, and /var/run/libvirt/libvirt-sock file is removed.
# yum remove libvirt
  Erasing        : libvirt-0.8.1-13.el6.x86_64                              1/1 

  libvirt.x86_64 0:0.8.1-13.el6                                                 


# service libvirtd status
libvirtd: unrecognized service

# ls -l /var/run/libvirt/libvirt-sock
ls: cannot access /var/run/libvirt/libvirt-sock: No such file or directory

Comment 10 2010-11-11 14:48:32 UTC
Red Hat Enterprise Linux 6.0 is now available and should resolve
the problem described in this bug report. This report is therefore being closed
with a resolution of CURRENTRELEASE. You may reopen this bug report if the
solution does not work for you.

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