Here are my two cents.
1) Currently there is no way to get the exit status of the process for ssh.
I quickly looked through the JCraft classes we use and even ChannelExec doesn't
have an ability to provide an exit value.
2) Speaking about telnet and the "echo $?", I don't think we should bring this solution into RSE.
Telnet is a pretty generic protocol and is not limited to Unix systems. We cannot assume
the existence of "echo" and bash on the remote side.
On Jun 23, 2011, at 5:35 PM, David McKnight wrote:
There currently are IRemoteCmdSubSystem.runCommand() APIs and corresponding IShellService.runCommand() APIs. I'm not sure whether the idea here is to provide additional ones, change the implementation of the existing ones or to do something completely different. So long as it's possible to provide an solution that can work for most protocols, I think this makes sense.
Martin and Anna, what are your thoughts on this?
Phone: 905-413-3902 , T/L: 969-3902
<graycol.gif>Vladimir Prus ---23/06/2011 01:19:47 AM---On Saturday, June 18, 2011 13:12:14 Vladimir Prus wrote: It seems that there's general agreement thi
On Saturday, June 18, 2011 13:12:14 Vladimir Prus wrote:
It seems that there's general agreement this is a good idea,
but would it possible to get a definite confirmation from TM
maintainers that a patch to introduce such "Run a command"
functionality will be welcome, in principle?
We would not like to spend time making an upstream-suitable patch
if it is contrary to RSE philosophy in some way and will never
CodeSourcery / Mentor Graphics
+7 (812) 677-68-40
> in a few cases in our product, we're interested in just running a command
> remotely, getting its exit status and output. At the same time, it's
> explicitly not desirable to show the user any console window with the
> command output.
> RSE provides shell service, which can be used to run a command, however
> this is good for interactive use, and has some problems when used to run a
> single command:
> - The commands see they have a terminal, and starts to behave
> interactively, like asking the user some questions, which is bad in our
> - There's no clear way to obtain command error status. Per Anna's
> suggestion, we used
> ; echo "Exit status is $?"
> but assumes such output is not shown by the program, and the last line of
> program output ends with newline, that we have a Linux target, and so on.
> - In addition to program output, there is output produced when logging in
> into the remote system, so we have to use some kludges to filter that out.
> It seems to me that it would be best if this complexity (which seems
> specific to different connections methods) be incapsualted inside RSE. So,
> there should be an API to run a command, which can be implemented:
> - Using SSH 'exec' channel for SSH connections
> - Using the above "echo" trick for telnet connections
> - Using whatever magic is necessary for DStore, or Windows, or other,
> connection types.
> Does this seem to make sense? Shall I file a bug?
dsdp-tm-dev mailing list
dsdp-tm-dev mailing list