Bug 924592 - rhn_check fails with remote command running in background
Summary: rhn_check fails with remote command running in background
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Spacewalk
Classification: Community
Component: Clients
Version: 1.9
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: Milan Zázrivec
QA Contact: Red Hat Satellite QA List
URL:
Whiteboard:
Depends On:
Blocks: space27
TreeView+ depends on / blocked
 
Reported: 2013-03-22 07:22 UTC by Mikhail
Modified: 2017-09-28 18:08 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-03-22 07:56:43 UTC
Embargoed:


Attachments (Terms of Use)

Description Mikhail 2013-03-22 07:22:52 UTC
Description of problem:
Remote command ending with '&' do not fork out from rhn_check process. Command is running successfilly but it doesn't return the promt to parrent process. So, rhn_check still waiting the end of execution, like as '&' is absent.

Steps to Reproduce:
1. create remote command ending with '&' (for running in background)
2. run rhn_check on client machine
3.
  
Actual results:

Summary: 	Run an arbitrary script scheduled by spaceadmin
Details: 	This action will be executed after 03/22/13 9:41:00 AM MSK.

This action's status is: Failed.
The client picked up this action on 03/22/13 9:43:55 AM MSK.
The client completed this action on 03/22/13 9:45:59 AM MSK.
Client execution returned "Script killed, timeout of 120 seconds exceeded" (code 1)


Run as: root:root
Timeout: 120 seconds

#!/bin/sh
(tail -f /var/log/somelogfile > /tmp/dest_file) &


Start Date: 2013-03-22 00:00:00
End Date: 2013-03-22 00:00:00
Return Code: 0
Raw Output: view/download raw script output
Filtered Output:


Expected results:
rhn_check shouldn't wait the end of execution of remote command running in background (like as it happens with manual command execution in bash)

Additional info:
# rhn_check -vvv
<...>
D: do_call script.run(45, {'username': 'root', 'groupname': 'root', 'now': '2013-03-22 10:43:55', 'timeout': 120, 'script': '#!/bin/sh\n(tail -f /var/log/somelogfile > /tmp/dest_file) &'}){'cache_only': None}
D: Sending back response(1, 'Script killed, timeout of 120 seconds exceeded', {'output': '', 'base64enc': 1, 'process_end': '2013-03-22 10:45:57', 'return_code': 0, 'process_start': '2013-03-22 10:43:55'})
D: do_call packages.checkNeedUpdate('rhnsd=1',){}
<...>

Comment 1 Milan Zázrivec 2013-03-22 07:56:43 UTC
This is supposed to work this way.

When executing remote command, Spacewalk needs to know the result of
the action -- this is so that it can actually display whether or not
was the action successful.

If you need to execute a remote command which would have to stay running
on the machine, the remote process needs to be daemonized.

Comment 2 Eric Herget 2017-09-28 18:08:20 UTC
This BZ closed some time during 2.5, 2.6 or 2.7.  Adding to 2.7 tracking bug.


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