Search Members Help

» Welcome Guest
[ Log In :: Register ]

Mini-ITX Boards Sale, Fanless BareBones Mini-ITX, Bootable 1G DSL USBs, 533MHz Fanless PC <-- SALE $200 each!
Get The Official Damn Small Linux Book. DSL Market , Great VPS hosting provided by Tektonic
Pages: (2) </ 1 [2] >/

[ Track this topic :: Email this topic :: Print this topic ]

reply to topic new topic new poll
Topic: Starting applications remotely, application dies after exit remote ssh< Next Oldest | Next Newest >
el_supremo Offline





Group: Members
Posts: 5
Joined: July 2004
Posted: Aug. 20 2004,04:37 QUOTE

Quote
I was trying to run my script as myscript & (to run in background). On exiting ssh, my script would also exit and application would shutdown (still need to understand why).

I don't know the specifics but I can perhaps point you in the right direction.
It's something to do with the way that ssh handles the SIGHUP signal when you logout.
When you run a script as "myscript &", a shell (ssh) is spawned in the background to execute the script commands.
When you put the & on the java command in the script, the script itself is still executed by the foreground ssh until it gets to the java command which it then puts in the background.
I think that when it puts a process like java in the background, it makes it immune to the SIGHUP signal so that when you log out it, the shell (ssh) will die but the java will keep running.
However, it would appear that when it spawns a copy of itself (to do "myscript &") it does not make that immune to SIGHUP and so the script dies when you logout.

Best Wishes
Pete
Back to top
Profile PM 
5 replies since June 21 2004,02:59 < Next Oldest | Next Newest >

[ Track this topic :: Email this topic :: Print this topic ]

Pages: (2) </ 1 [2] >/
reply to topic new topic new poll
Quick Reply: Starting applications remotely

Do you wish to enable your signature for this post?
Do you wish to enable emoticons for this post?
Track this topic
View All Emoticons
View iB Code