RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 726649 - /var/run/libvirtd.pid will be lost after restarting libvirtd with vdsm installed
Summary: /var/run/libvirtd.pid will be lost after restarting libvirtd with vdsm installed
Keywords:
Status: CLOSED DUPLICATE of bug 728153
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt
Version: 6.2
Hardware: Unspecified
OS: Linux
urgent
urgent
Target Milestone: rc
: 6.2
Assignee: Peter Krempa
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-07-29 10:37 UTC by Nan Zhang
Modified: 2011-09-22 10:37 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-09-22 10:37:17 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Nan Zhang 2011-07-29 10:37:14 UTC
Description of problem:
Install libvirt with vdsm, restart libvirtd & vdsmd service over 2 times, it will cause libvirtd failed.

Version-Release number of selected component (if applicable):
libvirt-0.9.4-0rc2.el6.x86_64
vdsm-4.9-86.el6.x86_64

How reproducible:
always

Steps to Reproduce:
[root@amd-1352-8-4 ~]# service libvirtd restart
Stopping libvirtd daemon:                                  [FAILED]
Starting libvirtd daemon:                                  [  OK  ]
[root@amd-1352-8-4 ~]# service vdsmd restart
Shutting down vdsm daemon: 
vdsm watchdog stop                                         [  OK  ]
vdsm: not running                                          [FAILED]
Stopping libvirtd daemon:                                  [  OK  ]
Configuring libvirt for vdsm...
Starting iscsid...
Starting multipathd...
Starting multipathd daemon:                                [  OK  ]
Starting iscsid:                                           [  OK  ]
Starting up vdsm daemon: 
vdsm start
[root@amd-1352-8-4 ~]# rpm -q libvirt
libvirt-0.9.4-0rc2.el6.x86_64
[root@amd-1352-8-4 ~]# rpm -q vdsm
vdsm-4.9-86.el6.x86_64
[root@amd-1352-8-4 ~]# service vdsmd status
VDS daemon server is running
[root@amd-1352-8-4 ~]# service libvirtd status
libvirtd (pid  2757) is running...
[root@amd-1352-8-4 ~]# service libvirtd restart
Stopping libvirtd daemon:                                  [  OK  ]
Starting libvirtd daemon: libvirtd: error: Unable to obtain pidfile. Check /var/log/messages or run without --daemon for more info.
                                                           [FAILED]
[root@amd-1352-8-4 ~]# service libvirtd status
libvirtd (pid  3269) is running...
[root@amd-1352-8-4 ~]# ls /var/run/libvirtd.pid
/var/run/libvirtd.pid
[root@amd-1352-8-4 ~]# cat /var/run/libvirtd.pid
3269
[root@amd-1352-8-4 ~]# service libvirtd restart
Stopping libvirtd daemon:                                  [  OK  ]
Starting libvirtd daemon: libvirtd: error: Unable to initialize network sockets. Check /var/log/messages or run without --daemon for more info.
                                                           [FAILED]
[root@amd-1352-8-4 ~]# cat /var/run/libvirtd.pid
cat: /var/run/libvirtd.pid: No such file or directory
  
Actual results:
libvirtd fail to restart.

Expected results:
libvirtd daemon restart sucessfully.

Additional info:

Comment 1 Nan Zhang 2011-07-29 14:28:27 UTC
Run with the following commands will increase the odds of reproducing.

# service libvirtd restart && service vdsmd restart

Comment 2 Nan Zhang 2011-08-03 09:49:17 UTC
Once encountered this problem, to do the below steps can resolve this issue.

1. Remove all the configurations which added by vdsm in the following 2 libvirtd config files.

/etc/libvirt/libvirtd.conf
--------------------------
listen_addr="0" # by vdsm
unix_sock_group="kvm" # by vdsm
unix_sock_rw_perms="0770" # by vdsm
auth_unix_rw="sasl" # by vdsm
save_image_format="lzop" # by vdsm
log_outputs="1:file:/var/log/libvirtd.log" # by vdsm
log_filters="1:libvirt 3:event 3:json 1:util 1:qemu" # by vdsm
auth_tcp="none" # by vdsm
listen_tcp=1 # by vdsm
listen_tls=0 # by vdsm

/etc/sysconfig/libvirtd
--------------------------
LIBVIRTD_ARGS=--listen # by vdsm
DAEMON_COREFILE_LIMIT=unlimited # by vdsm

2. Restart libvirtd service
# service libvirtd restart

3. Restart vdsmd service
# service vdsmd restart

Comment 3 Dave Allan 2011-08-10 19:51:54 UTC
Dan, is this addressed by the patch series you posted today (https://www.redhat.com/archives/libvir-list/2011-August/msg00349.html)?

Comment 4 Daniel Berrangé 2011-08-11 09:33:30 UTC
That wasn't my intention with those patches, but it might be a happy accident.

Comment 5 Daniel Veillard 2011-09-08 07:04:29 UTC
I think the bug comes from libvirt daemon/libvirtd.upstart script
which happens to do:

post-stop script
    rm -f $PIDFILE
    rm -rf /var/cache/libvirt/*
end script


it removes the PIDFILE without checking if the daemon is still running.
I think the vdsmd service is activating that upstart script and we end
up with case where upstart think the daemon is dead (or just not 'responding'
quickly enough) and it restarts it
We then end up with a second daemon being started while another one is
running, this leads to massive confusion, errors, etc ...

IMHO the right thing is to fix that script to not remove the
pidfile if the given process still exist and is a libvirt daemon.

Daniel

Comment 6 Peter Krempa 2011-09-22 10:37:17 UTC
This bug arises from using SysV Init script together with upstart script. 

VDSM starts libvirtd using upstart, as it requires automatic respawning of libvirtd in case of a crash.If the user thereafter uses the SysV init script, it removes the pid file and kills the daemon. This triggers upstart to respawn the daemon as upstart thinks it crashed. This results in a pretty much undefined state.

Correct procedure for the user is to use initctl restart libvirtd to achieve the desired operation and not to trigger the bug.

This is a duplicate of https://bugzilla.redhat.com/show_bug.cgi?id=728153

*** This bug has been marked as a duplicate of bug 728153 ***


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