Daemonizing python's BaseHTTPServer

后端 未结 6 1895
南方客
南方客 2021-02-05 20:35

I am working on a daemon where I need to embed a HTTP server. I am attempting to do it with BaseHTTPServer, which when I run it in the foreground, it works fine, but when I tr

6条回答
  •  广开言路
    2021-02-05 21:13

    Just use daemontools or some other similar script instead of rolling your own daemonizing process. It is much better to keep this off your script.

    Also, your best option: Don't use BaseHTTPServer. It is really bad. There are many good HTTP servers for python, i.e. cherrypy or paste. Both includes ready-to-use daemonizing scripts.

提交回复
热议问题