Re: Xterm/Login hangs after starting remote service
Date: Thu, 13 Jan 2005 09:28:36 +0000 (UTC)
> I`m loggin into a remote site via ssh from an existing login shell.
> Then I start a program using a start script.
> The script contains the following start line to run the program:
> nohup /opt/java/bin/java -jar httpd.jar localhost:80 2>&1 >>
> standard_input_output.log &
> This works - the program starts up. However, when I logout my xterm
> window hangs and I do not get back to the login shell from before.
What you do is the following (in symbolic notation):
stderr = stdout;
stdout = fopen("standard_input_output.log", "a");
After these two operations stderr still points to the original stdout,
so your stderr writes to the terminal, resulting in the observed behaviour.
The solution is to reverse the redirections:
nohup /opt/java/bin/java -jar httpd.jar localhost:80 \
>>standard_input_output.log 2>&1 &
- Re: using IPC::Open3 to write to *and* read from a process...
... script an external binary at all. ... output on STDOUT or STDERR, and if I can write to the process on STDIN ... sub handle_sigchild ... in any case a filehandle knows if it's open or not. ...
- Re: Using subprocess module to launch a shell shell script that itself forks a process
... STDERR, the child will block waiting for the parent to read STDERR, ... process started by the shell script tries to read from STDIN. ... occurs because of the forked Java process, ...
- Re: Process.BeginErrorReadLine and BeginOutputReadLine; buffer not flushed?
... script, and redirects the stdout and stderr output from that script ... That means that if the process gets ahead of your reading process at all, the reading process can still wind up in a thread that's happy to keep reading the stream it's working on, while the OS buffers output sent to the other string. ...
- Re: wife-proof way to launch ppp?
... enhanced text field, that doesn't really matter. ... You could settle on having her login shell ... You could even start X with a script from her ... Does that mac support running NetBSD? ...
- Open3 with nonblocking reads
... I'm currently trying to execute a script within a script, ... single line should contain if it's STDOUT or STDERR, ... STDOuts were passed to the logfile. ...