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 over 3 years ago. Updated over 3 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

Also available in: Atom PDF