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 1494389 - rhn_check does not handle reboot coming from outside well
Summary: rhn_check does not handle reboot coming from outside well
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: rhn-client-tools
Version: 7.4
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Tomáš Kašpárek
QA Contact: Red Hat Satellite QA List
Filip Hanzelka
URL:
Whiteboard:
Depends On:
Blocks: 1467342 1491451 1498813
TreeView+ depends on / blocked
 
Reported: 2017-09-22 07:34 UTC by Tomáš Kašpárek
Modified: 2021-03-11 15:49 UTC (History)
5 users (show)

Fixed In Version: rhn-client-tools-2.0.2-19-el7
Doc Type: Release Note
Doc Text:
"rhn_check" now correctly reports system reboots to Satellite Previously, if a system reboot of a Satellite client occurred during a "rhn_check" run, "rhn_check" did not report its termination to Satellite. Consequently, the status of "rhn_check" in Satellite did not update. With this update, this incorrect behavior is fixed and "rhn_check" now handles system reboots and reports the correct status to Satellite.
Clone Of:
Environment:
Last Closed: 2018-04-10 12:17:18 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2018:0759 0 None None None 2018-04-10 12:18:11 UTC

Description Tomáš Kašpárek 2017-09-22 07:34:19 UTC
Description of problem:
rhn_check does not handle reboot coming from outside well while 

Version-Release number of selected component (if applicable):
rhn-client-tools-2.0.2-17.el7.noarch

How reproducible:
always

Steps to Reproduce:
1. schedule remote script with sleep 200 or something like that
2. run rhn_check on the client
3. on the client run reboot/halt/shutdown ...

Actual results:
rhn_check does not report back to Satellite that it was killed by reboot. The action is still in picked up status in Satellite.

Expected results:
rhn_check reports to Satellite that reboot occurred.

Additional info:
In case rhn_check is killed by e.g. /usr/bin/pkill --signal TERM rhn_check it reports back to Satellite before it terminates and on Satellite there's: Client execution returned "Script executed. Termination signal occurred during execution" (code 0)

Comment 1 Tomáš Kašpárek 2017-10-05 14:07:07 UTC
revert of old commits regarding reboot loop:
spacewalk.git(master): 9ac3f5e5f59942f796f55a54de825a1a9e538ecd
spacewalk.git(master): a2f80a2e37122eab360905c08799130cbf8ca8ab
spacewalk.git(master): 5c57677a2d3279508a699b7bd4048411295f06c5
spacewalk.git(master): ddb5fa44c02d9cb913f5e2b38514bb6ed8d34f20
spacewalk.git(master): 850abcc8677cf7ad8095f159f71383cdc8076e43

actual fix:
spacewalk.git(master): 6f939e091079a543c91aa0108a7acb16f0658f09

Comment 5 Pavel Studeník 2017-12-08 11:20:02 UTC
>> rpm -q rhn-client-tools
rhn-client-tools-2.0.2-20.el7.noarch

I received following traceback (procedure by description). It doesn't look as correct message.

[Fri Dec  8 06:12:49 2017] up2date D: do_call script.run(129369, {'username': 'root', 'groupname': 'root', 'now': '2017-12-08 06:12:49', 'timeout': 600, 'script': '#!/bin/sh\n# Add your shell script below\n\nsleep 200\n'}){'cache_only': None}
[Fri Dec  8 06:13:30 2017] up2date 
Traceback (most recent call last):
  File "/usr/sbin/rhn_check", line 374, in __run_action
    (status, message, data) = CheckCli.__do_call(method, params, kwargs)
  File "/usr/sbin/rhn_check", line 367, in __do_call
    retval = method(*params, **kwargs)
  File "/usr/share/rhn/actions/script.py", line 260, in run
    input_fds, output_fds, error_fds = select.select([pipe_read], [], [], select_wait)
  File "/usr/share/rhn/actions/script.py", line 58, in handle
    raise SystemExit(SYSEXIT_CODE)
<type 'exceptions.SystemExit'>: 3

Comment 6 Pavel Studeník 2017-12-11 14:43:27 UTC
>> getenforce 
Permissive

>> rhn_check -vv
...

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

>> tail /var/log/up2date
    (status, message, data) = CheckCli.__do_call(method, params, kwargs)
  File "/usr/sbin/rhn_check", line 367, in __do_call
    retval = method(*params, **kwargs)
  File "/usr/share/rhn/actions/script.py", line 260, in run
    input_fds, output_fds, error_fds = select.select([pipe_read], [], [], select_wait)
  File "/usr/share/rhn/actions/script.py", line 58, in handle
    raise SystemExit(SYSEXIT_CODE)
<type 'exceptions.SystemExit'>: 3

>> rpm -q rhn-client-tools
rhn-client-tools-2.0.2-21.el7.noarch

I expect msg: "Script executed. Termination signal occurred during execution"

Comment 9 Pavel Studeník 2017-12-15 12:26:27 UTC
Verified with new version of rhncfg-* and rhn-client-tools-2.0.2-21.el7.noarch

signal SIGKILL - D: Sending back response(255, "Previous run of action didn't completed sucessfully, aborting.", {})

signal SIGTERM -  D: Sending back response(255, 'Termination signal occurred during execution.', {})

Comment 17 errata-xmlrpc 2018-04-10 12:17:18 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.

https://access.redhat.com/errata/RHBA-2018:0759


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