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: NEW
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: Unspecified
Assignee: satellite6-bugs
QA Contact: Peter Ondrejka
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-05-03 04:54 UTC by Prakash Ghadge
Modified: 2021-05-17 10:41 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 5315261 0 None None None 2021-05-03 05:05:47 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 %>
~~~


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