[Python-ideas] Detaching (daemonising) a process (was: Function multiple arguments assignment)

Ben Finney ben+python at benfinney.id.au
Wed Mar 23 04:05:55 CET 2011

"Joao S. O. Bueno" <jsbueno at python.org.br>

> In other news, last week I needed to "detach" a subprocess, and thre
> is no high-level way to do it. There is very little documentation on
> this, one mostly has to follow C documentation using "for" and arcane
> system calls (os.setsid and os._exit) to get a process to be
> daemonized.

PEP 3143, and its reference implementation ‘python-daemon’, are my
intended fix for this. I need to re-think how it uses lock files, but it
is already useful for many people.

The plan is to eventually get the ‘python-daemon’ implementation into
the standard library, so there's then One Obvious Way To Do It.

Please let me know how well it works for you.

 \          “Computer perspective on Moore's Law: Human effort becomes |
  `\           twice as expensive roughly every two years.” —anonymous |
_o__)                                                                  |
Ben Finney

More information about the Python-ideas mailing list