Red Hat Satellite engineering is moving the tracking of its product development work on Satellite 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 "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. 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 "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-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 1956158 - Attempt to restart a client using remote execution results in error shutdown: command not found
Summary: Attempt to restart a client using remote execution results in error shutdown:...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Remote Execution
Version: 6.8.0
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: 6.10.0
Assignee: Adam Ruzicka
QA Contact: Peter Ondrejka
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-05-03 04:54 UTC by Prakash Ghadge
Modified: 2024-06-14 01:25 UTC (History)
5 users (show)

Fixed In Version: tfm-rubygem-foreman_remote_execution-4.5.4
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-11-16 14:10:44 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 32496 0 Normal Ready For Testing Attempt to restart a client using remote execution results in error shutdown: command not found 2021-08-05 14:25:58 UTC
Red Hat Knowledge Base (Solution) 5315261 0 None None None 2021-05-03 05:05:47 UTC
Red Hat Product Errata RHSA-2021:4702 0 None None None 2021-11-16 14:10:50 UTC

Description Prakash Ghadge 2021-05-03 04:54:49 UTC
Description of problem:

Attempt to restart a client using remote execution results in error shutdown: command not found

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

> Satellite 6.8

How reproducible:

> In some cases it fails.

Steps to Reproduce:

> Unknown. But the workaround mentioned in additional info helped to resolve the issue.

Actual results:

> Restart task fails with the following error
~~~
   1:restart host
   2:/var/tmp/foreman-ssh-cmd-d1c44834-3875-4db1-ae22-e58a75f8fbb4/script: line 4: shutdown: command not found
   3:Exit status: 127
~~~

Expected results:

> Should restart the host without any error.

Additional info:

> There is a chance that the initialization of the PATH variable is not happening on the target host properly or it's not properly set for the SSH User.

The simple workaround is to modify the "Power Action - SSH Default" template with the absolute path of the "shutdown" command. Use "/sbin/shutdown" as this path is available on RHEL 6, 7, and 8.

~~~
echo <%= input('action') %> host && sleep 3
<%= case input('action')
     when 'restart'
       '/sbin/shutdown -r +1'
     else
       '/sbin/shutdown -h now'
     end %>
~~~

Comment 1 Bryan Kearney 2021-07-29 12:04:03 UTC
Upstream bug assigned to aruzicka

Comment 2 Bryan Kearney 2021-07-29 12:04:06 UTC
Upstream bug assigned to aruzicka

Comment 3 Bryan Kearney 2021-08-02 12:05:02 UTC
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/32496 has been resolved.

Comment 6 Peter Ondrejka 2021-08-16 13:23:49 UTC
Verified on Satellite 6.10 sn 13

Comment 9 errata-xmlrpc 2021-11-16 14:10:44 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 (Moderate: Satellite 6.10 Release), 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/RHSA-2021:4702


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