Detach running process?

Yannick Le Saint (kyncani) y.lesaint at gmail.com
Mon May 16 15:59:15 UTC 2005


> On 5/16/05, Scott Henson <scotth at csee.wvu.edu> wrote:
> > On Sun, 2005-05-15 at 17:16 +0200, Erik Bågfors wrote:
> > > Depends on how you define "detach".
> > >
> > > Perhaps ctrl-z followed by "bg" is what you are looking for.  Just
> > > remember that that process is still attached to your tty. So if you
> > > kill it, you kill the process.
> > 
> > Not entirely true.  After you bg(or background) a process, you can
> > disown it, by typing disown right after you type bg.  Or disown will
> > take a shell pid(its always %n where n is the number of processes
> > running under the shell).  I think it will also take system pids, but
> > I'm not sure.  man disown for more info on it.

  The process is still attached to the shell's tty :
------
/home/kyncani/ > ( sleep 10; echo "hello world" ) &
[1] 20979
/home/kyncani/ > jobs
[1]+  Running                 ( sleep 10; echo "hello world" ) &
/home/kyncani/ > disown %1
/home/kyncani/ > jobs
/home/kyncani/ > hello world
------

  The only convenient way i see (always using screen here) is to C-z to
put the job in background, bg it so that it keeps running and exit to
end the father's shell so that the process will loose its controlling
tty.

-- 
Yannick Le Saint (kyncani) <y.lesaint at gmail.com>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20050516/fdabd598/attachment.pgp>


More information about the ubuntu-users mailing list