Bug 864791

Summary: Virt-who status show as "virt-who dead but subsys locked" after kill the running virt-who server by press "ctrl+c" key.
Product: Red Hat Enterprise Linux 5 Reporter: cshao <cshao>
Component: virt-whoAssignee: Radek Novacek <rnovacek>
Status: CLOSED ERRATA QA Contact: Entitlement Bugs <entitlement-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 5.9CC: gouyang, hadong, huiwang, khong, leiwang, liliu, ovasik, sgao, shihliu, ycui
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: virt-who-0.9-1.el5 Doc Type: Bug Fix
Doc Text:
no docs needed
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-09-16 00:29:12 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description cshao 2012-10-10 07:11:18 UTC
Description of problem:
Running virt-who server in terminal and then press "ctrl + C" key to kill it,  virt-who status show as "virt-who dead but subsys locked".

Version-Release number of selected component (if applicable):
rhev-hypervisor5-5.9-20121003.1.el5
virt-who-0.7-8.el5

How reproducible:
100%

Steps to Reproduce:
1. Register RHEV-H to RHEV-M.
2. Register RHEV-H to SAM.
3. Running virt-who server in terminal, configure the /etc/sysconfig/virt-who file as follows:
    VIRTWHO_BACKGROUND=0
    VIRTWHO_DEBUG=1
    VIRTWHO_VDSM=1
    VIRTWHO_INTERVAL=1
4. /etc/init.d/virt-who start
5. Press Ctrl + C
6. /etc/init.d/virt-who status

Actual results:
1. Virt-who status show as "virt-who dead but subsys locked".
2. No such issue when running virt-who server in background with "VIRTWHO_BACKGROUND=1".

========================
VIRTWHO_BACKGROUND=0
# /etc/init.d/virt-who start 
Starting virt-who: WARNING: Listening for events is not available in VDSM or ESX mode
DEBUG: Virt-who is running in vdsm mode
DEBUG: Starting infinite loop with 1 seconds interval
DEBUG: Sending list of uuids: []

###press "ctrl + C" key###
                                                           [  OK  ]
# /etc/init.d/virt-who status
virt-who dead but subsys locked

# ps aux | grep virt-who
root      9234  0.0  0.0   8828  1404 pts/0    T    Oct09   0:00 /bin/sh /etc/init.d/virt-who restart
root      9239  0.0  0.0   8692  1096 pts/0    T    Oct09   0:00 /bin/bash -c ulimit -S -c 0 >/dev/null 2>&1 ; /usr/bin/virt-who
root     27054  0.0  0.0   6060   652 pts/0    S+   05:59   0:00 grep virt-who

========================
VIRTWHO_BACKGROUND=1
# /etc/init.d/virt-who restart
Stopping virt-who:                                         [  OK  ]
Starting virt-who:    


Expected results:
Virt-who status show as "virt-who is stopped" after kill the running virt-who server by press "ctrl+c" key.

Additional info:
It is a regression bug, because this is no such issue in rhev-hypervisor5-5.8-20120919.0.el5_8
virt-who-0.5-5.el5

================
VIRTWHO_BACKGROUND=0
# /etc/init.d/virt-who start
Starting virt-who: Virt-who is running in vdsm mode
Starting infinite loop with 1 seconds interval
Sending update to updateConsumer: []
Traceback (most recent call last):
  File "/usr/share/virt-who/virt-who.py", line 325, in ?
KeyboardInterrupt

###press "ctrl + C" key###
                                                           [FAILED]
[root@rhevm-vds-72-21 ~]# /etc/init.d/virt-who status
virt-who is stopped

Comment 1 RHEL Program Management 2014-01-29 10:35:58 UTC
This request was evaluated by Red Hat Product Management for inclusion
in a Red Hat Enterprise Linux release.  Product Management has
requested further review of this request by Red Hat Engineering, for
potential inclusion in a Red Hat Enterprise Linux release for currently
deployed products.  This request is not yet committed for inclusion in
a release.

Comment 2 Radek Novacek 2014-03-24 13:16:55 UTC
This bug should be fixed by the rebase to virt-who-0.9-1.el5.

Comment 4 Ying Cui 2014-07-28 10:06:39 UTC
As RHEV-H 5.x was end of life more than 1 year, so can not test this bug on 5.x.

Tested this issue on RHEV-H 6.5.z build(20140723.0.el6ev), still can reproduce this issue with virt-who-0.8-9.el6.noarch.

Comment 5 Radek Novacek 2014-07-28 10:16:18 UTC
Please, retest with virt-who-0.9-1.el5, it should fix this issue.

Comment 6 Ying Cui 2014-07-28 10:24:02 UTC
Libin,
  No rhevh 5.x build now, you can reproduce this issue on rhel 5.x firstly, then test/verify this bug on rhel 5.x + latest virt-who version for 5.x.

Thanks
Ying

Comment 7 Ying Cui 2014-07-28 10:26:32 UTC
(In reply to Radek Novacek from comment #5)
> Please, retest with virt-who-0.9-1.el5, it should fix this issue.

Hi Radek,
  As comment 4, this bug still can reproduce with virt-who-0.8-9.el6.noarch in rhel 6.x stream, we need to clone it to 6.6 tree.

Thanks
Ying

Comment 8 Radek Novacek 2014-07-28 10:33:42 UTC
RHEL-6.6 will contain virt-who-0.10-3.el6.

Proper virt-who version to test with are:
virt-who-0.10-3.el6 on RHEL-6.6 and
virt-who-0.9-5.el5 on RHEL-5.11.

Please use above mentioned builds of virt-who to check if this issue has been fixed already. Thank you.

Comment 9 Liushihui 2014-07-29 06:02:36 UTC
Verified it on virt-who-0.9-5.el5 and virt-who-0.10-3.el6.noarch

Steps to verify:
1. Register RHEL system to SAM.
2. Running virt-who server on libvirtd mode in terminal , configure the /etc/sysconfig/virt-who file as follows:
    VIRTWHO_BACKGROUND=0
    VIRTWHO_DEBUG=1
    VIRTWHO_INTERVAL=1
3. /etc/init.d/virt-who start
4. Press Ctrl + C
DEBUG: Virtual machine found: 6.5_Server_x86_64: 3708b2bb-0d4b-6fa6-bb44-44ee3149ea19
DEBUG: Virtual machine found: 6.5_Client_i386: 774a817c-1a09-8b8f-4093-591fcbf365a3
DEBUG: Virtual machine found: 7.0_Server_x86_64: 70144381-3aaf-9515-3a51-6e2114006451
DEBUG: Virtual machine found: 5.10_Server_x86_64: 7279afd4-20d4-e5dc-f4c6-673448beb038
DEBUG: Virtual machine found: 6.4_Server_x86_64: 0804e244-3b17-322e-e115-e5cc33a1e502
INFO: Sending list of uuids: [{'guestId': '0804e244-3b17-322e-e115-e5cc33a1e502', 'attributes': {'active': 0, 'virtWhoType': 'libvirt', 'hypervisorType': 'QEMU'}, 'state': 5}, {'guestId': '70144381-3aaf-9515-3a51-6e2114006451', 'attributes': {'active': 0, 'virtWhoType': 'libvirt', 'hypervisorType': 'QEMU'}, 'state': 5}, {'guestId': '7279afd4-20d4-e5dc-f4c6-673448beb038', 'attributes': {'active': 0, 'virtWhoType': 'libvirt', 'hypervisorType': 'QEMU'}, 'state': 5}, {'guestId': '774a817c-1a09-8b8f-4093-591fcbf365a3', 'attributes': {'active': 0, 'virtWhoType': 'libvirt', 'hypervisorType': 'QEMU'}, 'state': 5}, {'guestId': '3708b2bb-0d4b-6fa6-bb44-44ee3149ea19', 'attributes': {'active': 1, 'virtWhoType': 'libvirt', 'hypervisorType': 'QEMU'}, 'state': 1}]
^C                                                         [FAILED]

5. /etc/init.d/virt-who status,virt-who is stop 
[root@hp-z220-05 libvirt-test-API]# /etc/init.d/virt-who status
virt-who is stopped

Comment 11 errata-xmlrpc 2014-09-16 00:29:12 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2014-1206.html