Project

General

Profile

Actions

Bug #32496

closed

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

Added by Anand Agrawal almost 3 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
-
Target version:
-

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 %>
~~

Actions #1

Updated by The Foreman Bot almost 3 years ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman_remote_execution/pull/583 added
Actions #2

Updated by The Foreman Bot over 2 years ago

  • Assignee set to Adam Ruzicka
  • Pull request https://github.com/theforeman/foreman_remote_execution/pull/640 added
Actions #3

Updated by Adam Ruzicka over 2 years ago

  • Status changed from Ready For Testing to Closed
Actions #4

Updated by Adam Ruzicka over 2 years ago

  • Fixed in Releases foreman_remote_execution-4.7.0 added
Actions #5

Updated by Adam Ruzicka over 2 years ago

  • Fixed in Releases foreman_remote_execution-4.5.4 added
Actions

Also available in: Atom PDF