Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using python, daemonizing a process

Okay I have looked at python-daemon, and also at various other daemon related code recipes. Are there any 'hello world' tutorials out there that can help me get started using a python based daemonized process?

like image 799
Andres Charles Avatar asked Sep 03 '26 13:09

Andres Charles


1 Answers

The PEP 3143 contains several examples, the simplest one of which is:

import daemon

from spam import do_main_program

with daemon.DaemonContext():
    do_main_program()

This seems as straightforward as it gets. If there's something that's unclear, please pose specific questions.

like image 127
NPE Avatar answered Sep 05 '26 04:09

NPE



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!