Sunday, February 22, 2009

Backgrounding a running process

A process is running in the terminal and is associated with the terminal. Through the setsid() sys call we can disassociate it from the Terminal.
But from the command line how to disassociate it from the terminal. ie. If we close the terminal the process should not get terminated.

For this issue,
If process is already running, also if you are able to get the command prompt, try this command
$bg jobid
(Make sure that you are giving job id, not the process id).


If you are not able to get the command prompt, use Ctrl-Z, to stop it get command prompt. Once you get command prompt, use bg command as mentioned.

No comments: