Re: waitFor and return (very strange)

From: Gordon Beaton (not_at_for.email)
Date: 05/17/04


Date: 17 May 2004 10:01:24 +0200

On 17 May 2004 00:39:34 -0700, depo wrote:
> I don't find difference in env variables (printed by set command) when
> rsh started by command line or java.Must i set an hide variable?

I was not referring to environment *variables*. The runtime
environment itself is slightly different when you run from an
interactive or non-interactive shell, because the situations are
treated differently by the remote shell.

> But when rsh is started by command line i see 3 lines (and all is ok
> rsh doesn't return if remote gui is running)
>
> access control disabled from any host
> ttytype=couldn't open /dev/tty for reading
> stty : Unknown error
>
> In java code input stream proc.getInputStream() and
> proc.getErrorStream() print nothing and rsh returns after few
> minutes

These messages appear to come from the shell initialization on the
remote host (.bashrc, .bash_profile, .tcshrc or similar). If you don't
see these lines when you use rsh from java, it means that there is a
difference in the way the remote login shell handles the
non-interactive case. There may also be some conditional expressions
in the login scripts on the remote host.

These are all Unix issues that have nothing to do with Java. Read the
man pages for the remote shell, paying particular attention to
concepts like login, non-login, interactive and non-interactive
shells. Ask further questions in an appropriate unix shell newsgroup.

> Using as Dario said
> rsh 172.16.241.97 -n -l bmsadmin
> "/opt/bms/STLS/unixcommands/srv_start..."
> provokes command line returns as in java case

Did you try my first suggestion, to leave the OutputStream open?

/gordon

-- 
[  do not email me copies of your followups  ]
g o r d o n + n e w s @  b a l d e r 1 3 . s e


Relevant Pages

  • Re: Announcing Viewglob 2.0
    ... It tracks the command line and environment of any number ... > of interactive shells (local and remote). ... > - Sharing a single display between multiple terminals ... > I have a great appreciation for the Unix shell - I'm of the ...
    (comp.unix.shell)
  • How to fetch process output incrementally?
    ... * Log in to a remote host using ssh, telnet, ssl-telnet, or something ... then look if the command has produced some output. ... fetch the stdout and stderr output. ... to a Bourne-ish shell on the remote end (my program does "exec ...
    (comp.unix.shell)
  • Re: output of rsh commands
    ... > Following is extracted from the rsh man page: ... > The following command: ... > always goto remote machine. ... stay on your local machine, don't pipe it to rsh to send to the remote ...
    (comp.unix.shell)
  • rsh gives "insufficient credentials"
    ... I have a user who is trying to use rsh to execute a command on a remote ...
    (SunManagers)
  • Announcing Viewglob 2.0
    ... Viewglob is a filesystem visualization add-on for Bash and Zsh. ... shells (local and remote). ... Since the draw of the command line is the ability to do things quickly ... I have a great appreciation for the Unix shell - I'm of the opinion ...
    (comp.unix.shell)