Bug 1036561

Summary: Virt-who start failed when set it to non-background mode
Product: Red Hat Enterprise Linux 7 Reporter: Liushihui <shihliu>
Component: virt-whoAssignee: Radek Novacek <rnovacek>
Status: CLOSED CURRENTRELEASE QA Contact: gaoshang <sgao>
Severity: high Docs Contact:
Priority: unspecified    
Version: 7.0CC: liliu, ovasik, qianzhan, sgao
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: virt-who-0.8-10.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-06-13 10:39:22 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:

Description Liushihui 2013-12-02 09:51:30 UTC
Description of problem:
Set virt-who to non-background mode(VIRTWHO_BACKGROUND=0), Then restart virt-who, it can't be started.

Version-Release number of selected component (if applicable):
subscription-manager-1.10.6-1.el7.x86_64
python-rhsm-1.10.6-1.el7.x86_64
virt-who-0.8-8.el7.noarch

How reproducible:
Always

Steps to Reproduce:
1. Prepare RHEL7.0 with latest subscription-manager and virt-who installed. 

2. On the terminal1: Configure virt-who isn't in background mode as the following:
[root@hp-z220-03 ~]# cat /etc/sysconfig/virt-who 
    VIRTWHO_BACKGROUND=0
    # Enable debugging output.
    VIRTWHO_DEBUG=1
    VIRTWHO_INTERVAL=20 
[root@dhcp-65-83 /]# systemctl start virt-who

3. On the terminal2: Check the virt-who status
[root@dhcp-65-175 ~]# systemctl status virt-who
virt-who.service - Daemon for reporting virtual guest IDs to subscription-manager
   Loaded: loaded (/usr/lib/systemd/system/virt-who.service; disabled)
   Active: activating (start) since Mon 2013-12-02 20:52:42 CST; 1min 19s ago
  Control: 3515 (python)
   CGroup: /system.slice/virt-who.service
           └─3515 /usr/bin/python /usr/share/virt-who/virt-who.py
Dec 02 20:52:42 dhcp-65-175.nay.redhat.com python[3515]: Virt-who is running in libvirt mode
Dec 02 20:52:42 dhcp-65-175.nay.redhat.com python[3515]: Starting infinite loop with 20 seconds interval
Dec 02 20:52:42 dhcp-65-175.nay.redhat.com virt-who[3515]: DEBUG: Sending list of uuids: []
Dec 02 20:52:42 dhcp-65-175.nay.redhat.com python[3515]: Sending list of uuids: []
Dec 02 20:53:02 dhcp-65-175.nay.redhat.com virt-who[3515]: DEBUG: Sending list of uuids: []
Dec 02 20:53:02 dhcp-65-175.nay.redhat.com python[3515]: Sending list of uuids: []
Dec 02 20:53:23 dhcp-65-175.nay.redhat.com virt-who[3515]: DEBUG: Sending list of uuids: []
Dec 02 20:53:23 dhcp-65-175.nay.redhat.com python[3515]: Sending list of uuids: []
Dec 02 20:53:44 dhcp-65-175.nay.redhat.com virt-who[3515]: DEBUG: Sending list of uuids: []
Dec 02 20:53:44 dhcp-65-175.nay.redhat.com python[3515]: Sending list of uuids: []

4. After about 80s , check the virt-who status
[root@dhcp-65-175 ~]# systemctl status virt-who
virt-who.service - Daemon for reporting virtual guest IDs to subscription-manager
   Loaded: loaded (/usr/lib/systemd/system/virt-who.service; disabled)
   Active: failed (Result: timeout) since Mon 2013-12-02 20:54:12 CST; 10s ago
  Process: 3515 ExecStart=/usr/bin/virt-who (code=exited, status=0/SUCCESS)
Dec 02 20:53:02 dhcp-65-175.nay.redhat.com python[3515]: Sending list of uuids: []
Dec 02 20:53:23 dhcp-65-175.nay.redhat.com virt-who[3515]: DEBUG: Sending list of uuids: []
Dec 02 20:53:23 dhcp-65-175.nay.redhat.com python[3515]: Sending list of uuids: []
Dec 02 20:53:44 dhcp-65-175.nay.redhat.com virt-who[3515]: DEBUG: Sending list of uuids: []
Dec 02 20:53:44 dhcp-65-175.nay.redhat.com python[3515]: Sending list of uuids: []
Dec 02 20:54:04 dhcp-65-175.nay.redhat.com virt-who[3515]: DEBUG: Sending list of uuids: []
Dec 02 20:54:04 dhcp-65-175.nay.redhat.com python[3515]: Sending list of uuids: []
Dec 02 20:54:12 dhcp-65-175.nay.redhat.com systemd[1]: virt-who.service operation timed out. Terminating.
Dec 02 20:54:12 dhcp-65-175.nay.redhat.com systemd[1]: Failed to start Daemon for reporting virtual guest IDs to subscription-manager.
Dec 02 20:54:12 dhcp-65-175.nay.redhat.com systemd[1]: Unit virt-who.service entered failed state.

Actual results:
After step2, it hasn't any virt-who log message pop up on the terminal1, virt-who has hang up
After step4, virt-who start failed and it pop up error message on the terminal1:
[root@dhcp-65-175 ~]# systemctl start virt-who
Job for virt-who.service failed. See 'systemctl status virt-who.service' and 'journalctl -xn' for details.

Expected results:
After step2: virt-who log should be pop up on the terminal1
After step4: virt-who should be start successfully. and it shouldn't pop up any error messages on the terminal1.

Additional info:
RHEL6.5-RC-1.2(20131105.6)-Server-x86_64(virt-who-0.8-9.el6.noarch) hasn't this problem
RHEL6.4-20130130.0-Server-x86_64(virt-who-0.8-5.el6.noarch) also hasn't this problem

Comment 2 Radek Novacek 2013-12-04 08:02:34 UTC
Running virt-who in non-background mode with systemd doesn't make sense. I will remove the VIRTWHO_BACKGROUND option from the configuration file and will ignore this environmental variable at all.

Comment 3 Radek Novacek 2013-12-12 08:37:19 UTC
Fixed in virt-who-0.8-10.el7.

Comment 5 Liushihui 2013-12-20 09:22:18 UTC
Verified on Rhel7.0-20131219.0(virt-who-0.8-10.el7), VIRTWHO_BACKGROUND option has been removed from the configuration file.

Comment 6 Ludek Smid 2014-06-13 10:39:22 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.