简体   繁体   中英

python packages/tools to daemonize application

I want to daemonize a python application. I've heard of forever and upstart for Node.js, are there similar tools I can use for python?

There are many great libraries for this, such as:

daemonize

Example:

from time import sleep
from daemonize import Daemonize

pid = "/tmp/test.pid"


def main():
    while True:
        sleep(5)

daemon = Daemonize(app="test_app", pid=pid, action=main)
daemon.start()

Update:

If you just want something like a supervisor, process control, init, etc I highly recommend you check out: http://pypi.python.org/pypi/supervisor

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM