new article(s) today

February 14, 2010

Using disown to disown a process #linux #remote

Filed under: tech, tp — jeetu @ 8:16 am

I find myself in a situation where I am logged in remotely to a server and have started a long running process, only to realize that I didnt kick off a screen session before, neither did I use nohup

In such a situation, the disown command comes in handy

disown -h %1

After I background the process, I disown it from the current terminal. The disown prevents a SIGHUP to the process if my terminal dies!

from the man page –

disown [-ar] [-h] [jobspec ...]
Without  options,  each  jobspec is removed from the table of active jobs.  If the -h option is given, each jobspec is not removed from the table, but is marked so that SIGHUP is not sent to the job if the shell receives a SIGHUP.  If no jobspec is present, and  neither  the  -a nor  the -r option is supplied, the current job is used.  If no jobspec is supplied, the -a option means to remove or mark all jobs; the -r option without a jobspec argument restricts operation to running jobs.  The return value is 0 unless a jobspec does  not  specify  a  valid job.

Thats it for a sunday morning! To own something can be a lot of responsibility, disown it and rest in peace :-)

April 26, 2009

Poker

Filed under: tp — Tags: , , — jeetu @ 10:23 pm
Unleashing the gambler within

Unleashing the gambler within