Bug 1409570

Summary: rhn_check should report some status when terminated
Product: Red Hat Enterprise Linux 7 Reporter: Jiří Dostál <jdostal>
Component: rhn-client-toolsAssignee: Jiří Dostál <jdostal>
Status: CLOSED ERRATA QA Contact: Pavel Studeník <pstudeni>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.2CC: jhutar, pstudeni, tlestach
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-08-01 22:19:00 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:
Bug Depends On:    
Bug Blocks: 1395284    

Description Jiří Dostál 2017-01-02 13:41:33 UTC
Description of problem:
When rhn_check is processing some action (executes script for example) and gets terminated, rhn_check exits immediately and doesn't report any status. This might result in inconsistent action states.

This Bugzilla has been created from https://bugzilla.redhat.com/show_bug.cgi?id=1260527 

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

How reproducible:
Always on RHEL 7

Steps to Reproduce:
1.  Register a RHEL 7 VM to satellite 5.7
2.  Assign provisioning entitlement to RHEL 7 system
3.  Subscribe RHEL 7 system to RHN tools channel.
4.  Install rhncfg and osad packages on RHEL 7 system using below command :
    # yum install rhncfg*
    # yum install osad
5   enable all actions for RHEL 7 system by executing below command :
    # rhn-actions-control --enable-all
6.  Go to RHEL 7 systems profile on satellite webui.
7.  Click on "Details" tab.
8.  Click on "Remote Command".
9.  In "Script" section add following command
    shutdown -h now  
10. Select appropriate time interval and date.
11. Click on schedule.
12. Now wait till command is executed. Once system is shutdown observe its status satellite webui.

Actual results:

1. Command is executed and system shuts down.
2. Status on satellite webUI remains as "The client has not yet completed this action"
3. When we power-on the system again the task gets executed and system gets shutdown
This goes in a loop. Action is never marked as completed.

Expected results:

1. Command is executed and system shuts down.
2. Status on satellite webUI should be : Completed

Additional info:
See https://bugzilla.redhat.com/show_bug.cgi?id=1260527 for original bug report.

This is fixed in spacewalk.git by 

Comment 2 Pavel Studeník 2017-06-23 14:34:18 UTC
I try reproducer on RHEL7.3 with package rhn-client-tools-2.0.2-8.el7.noarch

Error: Client execution returned "Fatal error in Python code occurred [[6]]" (code -1)

Verified on RHEL 7.4 with rhn-client-tools-2.0.2-11.el7.noarch

Comment 3 errata-xmlrpc 2017-08-01 22:19:00 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.