Bug #32496
closedAttempt to restart a client using remote execution results in error shutdown: command not found
Description
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 &x%x sleep 3
<%= case input('action')
when 'restart'
'/sbin/shutdown -r +1'
else
'/sbin/shutdown -h now'
end %>
~~
Updated by The Foreman Bot over 3 years ago
- Status changed from New to Ready For Testing
- Pull request https://github.com/theforeman/foreman_remote_execution/pull/583 added
Updated by The Foreman Bot over 3 years ago
- Assignee set to Adam Ruzicka
- Pull request https://github.com/theforeman/foreman_remote_execution/pull/640 added
Updated by Adam Ruzicka over 3 years ago
- Status changed from Ready For Testing to Closed
Applied in changeset foreman_plugin|aebaf0ad8d3826bf1e3bb559df92e4d06a1dca57.
Updated by Adam Ruzicka over 3 years ago
- Fixed in Releases foreman_remote_execution-4.7.0 added
Updated by Adam Ruzicka over 3 years ago
- Fixed in Releases foreman_remote_execution-4.5.4 added