Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

VOS remote ssh session with pseudo tty and shell exit code

82 views
Skip to first unread message

aaditya sood

unread,
Aug 15, 2010, 1:59:07 AM8/15/10
to
Hello all,

We (www.ideadevice.com) are building an IT workflow automation product
which works over ssh (among other things) to deliver bespoke
automation.
I am trying to automate running remote commands on a VOS server via
ssh (at a customer in Mumbai, India), but am stuck at one point.

I would be grateful for any help, advice or pointers the community can
provide.

The problem is that when I invoke the ssh command line client with the
-t option (Force pseudo-tty allocation) I can run remote bash commands
but do not get their exit status back. After running the shell
commands/script the sshd daemon drops me into the VOS command
processor and I cannot feed commands to it via stdin. Sample session:

ssh -t user@vos-host "echo Hello World"

prints "Hello World" and then drops into the command processor. I have
to manually type 'logout' to quit the session. I can see that my TERM
is set to vt100, even though it's a non-interactive login. The ssh
daemon does not send any exit code back (null).

The same command works with the session closing and exit code when I
use ssh without the -t option:

ssh user@vos-host "echo Hello World"
echo $?

It prints "Hello World" and returns me an exit code of 0. If command
is not found, it returns 127.
I need to use -t because I want to have job control over the processes
I create. Otherwise I can start a 'sleep 60', kill my ssh session and
the command keeps on going.

Is there something in the VOS configuration that will enable this for
me?

I have read the docs at
http://stratadoc.stratus.com/vos/17.0.2/r521-02b/wwhelp/wwhimpl/js/html/wwhelp.htm?context=r521-02b&file=ch2r521-02be.html
but unable to figure what, if any, configuration I should change.

As a last resort I can use expect like design to feed the logout
command to the command processor, and hack my way into saving the
shell exit code. But I'd rather not.

Once again, I would be grateful for any help, advice or pointers the
community can provide.

Thanks in advance

regards
--
aaditya sood
aad...@gmail.com

Paul Green

unread,
Aug 17, 2010, 7:30:19 AM8/17/10
to
Hi Aaditya,

Would you please re-port your question to the "OpenVOS and VOS Forum" at
http://openvos.com ? Stratus no longer monitors this newsgroup.

Thanks
PG


"aaditya sood" <aad...@gmail.com> wrote in message
news:ef47a958-7966-49c1...@w15g2000pro.googlegroups.com...

0 new messages