Keep a program running after SSH

This is a discussion on Keep a program running after SSH within the Linux Networking forums, part of the Linux Forums category; hello all ... this might be a simple question, but i'm kind of a linux noobie ... i have a FC5 ...


Go Back   Usenet Forums > Linux Forums > Linux Networking

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 10-14-2006
sublimanized@gmail.com
 
Posts: n/a
Default Keep a program running after SSH

hello all ... this might be a simple question, but i'm kind of a linux
noobie ...

i have a FC5 box in my apartment that my roommates and i use as a
fileserver.

.... since thats all it does, i want to put it to good use in its free
time..

i want to run a Folding@home client on it, but its a headless server,
.... i only have console access when i log in via SSH .... i want to
know how i can log in with SSH, and start the folding client, and then
log out, and keep the folding client alive on the machine when the SSH
client disconnects...

.... is this possible? ...

thank you ....

Reply With Quote
  #2 (permalink)  
Old 10-14-2006
Mihai Osian
 
Posts: n/a
Default Re: Keep a program running after SSH

sublimanized@gmail.com wrote:
> hello all ... this might be a simple question, but i'm kind of a linux
> noobie ...
>
> i have a FC5 box in my apartment that my roommates and i use as a
> fileserver.
>
> ... since thats all it does, i want to put it to good use in its free
> time..
>
> i want to run a Folding@home client on it, but its a headless server,
> ... i only have console access when i log in via SSH .... i want to
> know how i can log in with SSH, and start the folding client, and then
> log out, and keep the folding client alive on the machine when the SSH
> client disconnects...
>
> ... is this possible? ...
>
> thank you ....
>


After you login, you run "screen" (assuming it is installed). You run
whatever application you have, then detach from the terminal with
Ctrl-A-D. If you want to reattach, run "screen -r".

man screen
(also: man nohup)

Mihai
Reply With Quote
  #3 (permalink)  
Old 10-14-2006
John Thompson
 
Posts: n/a
Default Re: Keep a program running after SSH

On 2006-10-14, sublimanized@gmail.com <sublimanized@gmail.com> wrote:

> i have a FC5 box in my apartment that my roommates and i use as a
> fileserver.
>
> ... since thats all it does, i want to put it to good use in its free
> time..
>
> i want to run a Folding@home client on it, but its a headless server,
> ... i only have console access when i log in via SSH .... i want to
> know how i can log in with SSH, and start the folding client, and then
> log out, and keep the folding client alive on the machine when the SSH
> client disconnects...
>
> ... is this possible? ...


You can either start it in e.g. "rc.local" or run it in a screen
session. See "man screen" -- it's a useful program.

--

John (john@os2.dhs.org)
Reply With Quote
  #4 (permalink)  
Old 10-14-2006
Unruh
 
Posts: n/a
Default Re: Keep a program running after SSH

sublimanized@gmail.com writes:

>hello all ... this might be a simple question, but i'm kind of a linux
>noobie ...


>i have a FC5 box in my apartment that my roommates and i use as a
>fileserver.


>... since thats all it does, i want to put it to good use in its free
>time..


>i want to run a Folding@home client on it, but its a headless server,
>... i only have console access when i log in via SSH .... i want to
>know how i can log in with SSH, and start the folding client, and then
>log out, and keep the folding client alive on the machine when the SSH
>client disconnects...


>... is this possible? ...


>thank you ....


Yes, but you have to disassociate the input and outputs from the ssh
session.

name-of-program optionsofprogram >/tmp/out 2>&1 </dev/null &

should allow you to do that

Reply With Quote
  #5 (permalink)  
Old 10-15-2006
Vilmos Soti
 
Posts: n/a
Default Re: Keep a program running after SSH

Unruh <unruh-spam@physics.ubc.ca> writes:

>> i want to run a Folding@home client on it, but its a headless server,
>> ... i only have console access when i log in via SSH .... i want to
>> know how i can log in with SSH, and start the folding client, and then
>> log out, and keep the folding client alive on the machine when the SSH
>> client disconnects...

>
>>... is this possible? ...

>
>> thank you ....

>
> Yes, but you have to disassociate the input and outputs from the ssh
> session.
>
> name-of-program optionsofprogram >/tmp/out 2>&1 </dev/null &
>
> should allow you to do that


Or look around the "nohup" command.

Vilmos
Reply With Quote
  #6 (permalink)  
Old 10-15-2006
Raqueeb Hassan
 
Posts: n/a
Default Re: Keep a program running after SSH


Vilmos Soti wrote:
> Unruh <unruh-spam@physics.ubc.ca> writes:
>
> >> i want to run a Folding@home client on it, but its a headless server,
> >> ... i only have console access when i log in via SSH .... i want to
> >> know how i can log in with SSH, and start the folding client, and then
> >> log out, and keep the folding client alive on the machine when the SSH
> >> client disconnects...

> >
> >>... is this possible? ...

> >
> >> thank you ....

> >
> > Yes, but you have to disassociate the input and outputs from the ssh
> > session.
> >
> > name-of-program optionsofprogram >/tmp/out 2>&1 </dev/null &
> >
> > should allow you to do that

>
> Or look around the "nohup" command.
>
> Vilmos



screen did work fine with me all these years. As others said, it is
perfect for any headless server, never get killed!

$ screen client_app -switches -that -client -support
[ctrl] + A, D
(detached)

$

For reattaching the client

$ screen -r

When the client is through with it's job, the screen will terminate
automatically. Isn't that fantastic?

--
Raqueeb Hassan
Bangladesh

Reply With Quote
  #7 (permalink)  
Old 10-15-2006
Unruh
 
Posts: n/a
Default Re: Keep a program running after SSH

"Raqueeb Hassan" <wideangle@gmail.com> writes:


>Vilmos Soti wrote:
>> Unruh <unruh-spam@physics.ubc.ca> writes:
>>
>> >> i want to run a Folding@home client on it, but its a headless server,
>> >> ... i only have console access when i log in via SSH .... i want to
>> >> know how i can log in with SSH, and start the folding client, and then
>> >> log out, and keep the folding client alive on the machine when the SSH
>> >> client disconnects...
>> >
>> >>... is this possible? ...
>> >
>> >> thank you ....
>> >
>> > Yes, but you have to disassociate the input and outputs from the ssh
>> > session.
>> >
>> > name-of-program optionsofprogram >/tmp/out 2>&1 </dev/null &
>> >
>> > should allow you to do that

>>
>> Or look around the "nohup" command.
>>
>> Vilmos



>screen did work fine with me all these years. As others said, it is
>perfect for any headless server, never get killed!


>$ screen client_app -switches -that -client -support
>[ctrl] + A, D
>(detached)


>$


>For reattaching the client


>$ screen -r


>When the client is through with it's job, the screen will terminate
>automatically. Isn't that fantastic?



Yup, it probably is better than my suggestion.
It is nice that Linux gives you so many ways of doing things.


Reply With Quote
  #8 (permalink)  
Old 10-15-2006
Vilmos Soti
 
Posts: n/a
Default Re: Keep a program running after SSH

"Raqueeb Hassan" <wideangle@gmail.com> writes:

> screen did work fine with me all these years. As others said, it is
> perfect for any headless server, never get killed!
>
> $ screen client_app -switches -that -client -support
> [ctrl] + A, D
> (detached)


There is one problem with screen (which is not screen's fault).
If somebody breaks into your machine, then he can take over your
screen session. AFAIR, this is how Apache got rooted a couple of
years back. Somebody had su'd in screen, and it was taken over.

Vilmos
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 04:44 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0