[Gllug] Killing the client but leaving the process running

Richard Cohen richard at vmlinuz.org
Thu Mar 4 17:35:04 UTC 2004


On Thu, 4 Mar 2004, Tom Schutzer-Weissmann wrote:

> I used putty to get a terminal on a linux server on my windows machine.
> Now I want to go home and really I ought to log out of windows, but this
> will kill my session and an important backup running in the background.
>
> Out of curiosity, is there any way to get round this?

In advance, the answer is screen.  If you know you're starting a
long-running process and you think you may need to close down the network
connection, or logout, or close X, or whatever, start it under screen -
essentially, this lets the process think it's running on a normal session,
but you can connect and disconnect from the session at will.

It's bloody useful :-)

> As I understand it, my backup is a child process of a bash process, and
> bash is attached to a terminal that happens to be fed over the  network
> and displayed on my pc.
> So I'm thinking it should be possible for the terminal to be fed somewhere
> else, leaving my pc to do as it wishes.
> Or even - maybe - the bash process gets a different terminal?

For a running program, which isn't going to get upset at being backgrounded,
you might be able to get away with ctrl-z (to suspend the program and drop
you back to the shell), then "bg" (to restart the program in the background)
and then "disown -h %1" (to remove the first backgrounded program from the
job list, and tell bash not to tell it when it gets disconnected).

This may not work in all cases, so I'd suggest experimenting before trying
it on an important process...

> have a good evening,
> Tom SW

Cheers
Richard
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list