Re: Question on SSH hang on exit when running Java background process
- From: Darren Tucker <dtucker@xxxxxxxxxx>
- Date: Sun, 29 Apr 2007 12:00:04 +1000
YU Jiazi wrote:
hi, all
I'm not sure if i should ask this question in this maillist, i am sorry
if this mail bothered you. :)
My problem is that my SSH client hang on "exit" if I run a java program
as a background process.
Here is the sample java program:
Your program still has descriptors for stdin, stdout and stderr open and
sshd is waiting for them to close. Either have your program close those
descriptors or redirect them to /dev/null. You probably also want to
use "nohup" to prevent the program from exiting on SIGHUP.
nohup java -cp . Test </dev/null >/dev/null 2>&1 &
--
Darren Tucker (dtucker at zip.com.au)
GPG key 8FF4FA69 / D9A3 86E9 7EEE AF4B B2D4 37C9 C982 80C7 8FF4 FA69
Good judgement comes with experience. Unfortunately, the experience
usually comes from bad judgement.
- References:
- Prev by Date: Need Help Compiling Static sshd and ssh (4.3p2) In Solaris 8 and 10
- Next by Date: Re: Question on SSH hang on exit when running Java background process
- Previous by thread: Re: Question on SSH hang on exit when running Java background process
- Next by thread: Re: Question on SSH hang on exit when running Java background process
- Index(es):