[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: detaching a process from an ssh session ??



On Fri, 2004-06-25 at 08:06, Damian Morris wrote:
> to do it manually, you need to use one of the special ssh escape
> codes. from my ssh man page:
> 
>    Escape Characters
>      ~.      Disconnect.
> The one you want is "~." but make sure you enter it as the input on an
> empty line.

I discovered it even needs to be the first characters typed on a line,
not just an empty line.

The thing with this is that it terminates the backgrounded process.

Eg:

> ssh root@server
# # run a long-running process, background it:
# apt-move mirror
# <CTRL-Z>
# bg
# # disconnect ssh:
# ~.

All looks fine, except I go back in and check:
> ssh root@server
# ps aux|grep apt

and I get no output/ processes - and the CPU should be maxed out but
it's on zero; I'm guessing the process must have been killed.

Alternatively, if I do the same thing but use ssh's ~^Z (CTRL-Z)
sequence, that backgrounds ssh nicely enough, but if I try to exit my
_local_ shell, it tells me "there are stopped jobs".

And if I kill my local shell, the process on the server stops.

You see, I want to be able to log in from my laptop, start a
long-running process, and exit while the process continues.

I thought one of the above should have worked too.

If anyone knows a simple solution, please holler with an example command
line.

thanks
zen



Reply to: