Feature #19401
closedAllow choice of target shell in Remote Execution
Description
Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1445807
Description of problem:
Executing remote commands against hosts using cshell (csh) yields the following results:
- The command executes fine
- However, the exit code is 1
- "Illegal variable name" is output regardless of variable definitions
- Job status reverts to failed
This makes determining which jobs have failed on which hosts nearly impossible in an environment running primarily csh.
How reproducible:
Always.
Steps to Reproduce:
1. Set target host shell to csh
2. Run a simple command (i.e. ls) via REx against that host
Actual results:
The output indicates that the 'ls' command actually succeeded, however the job will always return as failed and the output shown will always complain about an 'Illegal variable name'
Expected results:
These results are "expected" given that REx templates appear to be written for bash, however it would be helpful in some environments if there were a set of script template equivalents with command syntax which could be used for different shells.
Below is the output received when sending a simple package installation task to a host:
-------
1:
Loaded plugins: langpacks, package_upload, product-id, search-disabled-repos,
2:
: subscription-manager
3:
Package ksh-20120801-26.el7.x86_64 already installed and latest version
4:
Nothing to do
5:
Illegal variable name.
6:
Exit status: 1
-------
Updated by Adam Ruzicka over 7 years ago
To get the exit code we read it from a file where it is stored like this:
$ tcsh $ echo foo > bar # The error we're encountering $ echo $(cat bar) Illegal variable name. $ echo $? 1 # Solution 1 $ echo `cat bar` foo # Solution 2 $ cat bar | xargs echo foo
t?csh apparently doesn't understand $(command), we'd have to use `command` or
Updated by The Foreman Bot over 7 years ago
- Status changed from New to Ready For Testing
- Pull request https://github.com/theforeman/foreman_remote_execution/pull/245 added
Updated by Anonymous over 7 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset foreman_plugin|aaa02f6eb0a8e5d77e5a6b2717d2d540f70a297b.
Updated by Ivan Necas over 7 years ago
- Related to Bug #19584: Some shells complain about heredoc ended by EOF added
Updated by Ivan Necas over 7 years ago
- Translation missing: en.field_release set to 263