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 >
colinbes Offline





Group: Members
Posts: 41
Joined: May 2004
Posted: June 21 2004,02:59 QUOTE

Not sure what I am doing wrong or why I am getting this behaviour.

If I ssh into embedded pc with DSL distro installed and start an application, using "appname &", it exits when I exit the ssh session. If I keep the ssh session open the application continues to execute.

I have done this many times with Suse/Redhat etc and am at a bit of a loss. The ability to fire up the application remotely is critical and would appreciate some wise words of wisdom.
Back to top
Profile PM 
Grim Offline





Group: Members
Posts: 284
Joined: Mar. 2004
Posted: June 21 2004,03:59 QUOTE

If SuSE/RedHat continued to run an application after you logged out, then SuSE/RedHat is doing something wrong.  All of your user instantiated processes should terminate once you logout of the system.  This behaviour is part of what allows UNIX-like operating systems to capitalize on system resources and provide a multi-user OS.

In order to do what you want done, you need to install and learn to use GNU screen.

It's available via apt:
Code Sample
apt-get install screen


Once installed on the system you wish to secure shell into, SSH into the box and type screen at the prompt.  Now start whatever program you want to continue to run.  After the program has started, type `CTRL-D' to detach the screen session.  The program continues to run and everybody's happy.

If you want to log back into the system and stop the process, ssh into the remote machine, type `screen -D -R' to reattach the session and proceed like you had never severed the connection.

There's actually a lot of digestable information at http://www.michael-prokop.at/screen/


--------------
No good deed goes unpunished...
Back to top
Profile PM WEB 
colinbes Offline





Group: Members
Posts: 41
Joined: May 2004
Posted: June 21 2004,12:09 QUOTE

Would be surprised if the Redhat/Suse side were wrong, what is more likely to be incorrect is my understanding of what I am doing. I thought one could spawn a process remotely and to be honest can't see why I can't (although my method could be wrong). With Suse/Redhat setup I am running tomcat apache and am able to fire these up remotely with no problem. For the learning curve I will look closer into what they are doing.

Thanks so much for your suggestion and will do as you suggest.
Back to top
Profile PM 
colinbes Offline





Group: Members
Posts: 41
Joined: May 2004
Posted: June 28 2004,18:43 QUOTE

Simple solution at end of day.

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).

What I then did was to edit my script and initiate application to run in background.
i.e. changed java -jar myapp.jar in script to java -jar myapp.jar &

Now running my script myscript allows me to exit ssh and my app still runs
Back to top
Profile PM 
ripcrd6 Offline





Group: Members
Posts: 155
Joined: Dec. 2003
Posted: Aug. 18 2004,07:41 QUOTE

screen would make a good .dsl

--------------
ripcrd6
----------------
Somewhere there is a village missing an idiot.
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