a subprocess qns

Lawrence D'Oliveiro ldo at geek-central.gen.new_zealand
Fri Apr 21 02:58:28 EDT 2006


In article <1145586597.202944.125920 at j33g2000cwa.googlegroups.com>,
 micklee74 at hotmail.com wrote:

>i wanted to start execute a command and put it in the background. i am
>using Unix.
>Usually i start this command using something like this :
>"/path/somecmd  &" with the "&" to put it to background.

Even if it's in the background with "&", it is still liable to get 
killed with a SIGHUP signal when you log off.

To stop this, you need to make sure the process is in its own process 
session group, by using the setsid system call. Not sure if there's any 
standard Python binding for this: but there is a setsid command that you 
could use from the shell.



More information about the Python-list mailing list