Bash/ZSH: Undoing ‘disown’

bashshellzsh

Is there a way to 'reattach' a process to the shells job table after it it has been 'disowned'?

Edit: $SEARCHENGINE totally fails me. Doesn't look too good.

Best Answer

Considering how linux jobs and process ownership works, I'm afraid it's not really possible to re-own a process, without help from the adopting process.

A parent may 'disown' a child, which is then 'adopted' by the process named 'init'. System security prevents someone from grabbing someone else's processes. When you disown it, a process becomes someone else's (init's) to control. You as the 'user' could still kill the process, but you can't get it back. Attempting to coerce init to return your process is unlikely to work, as init doesn't even read mail.

As mean as it sounds, it really boils down to the answer of "Don't do that!".

Related Question