3
問題,所以我一直在試圖使運行在後臺服務器的過程,並與守護進程啓動。所以我的代碼是:與Python-GEVENT和蟒蛇守護
class App():
def __init__(self):
self.stdin_path = '/dev/null'
self.stdout_path = '/dev/tty'
self.stderr_path = '/dev/tty'
self.pidfile_path = '/tmp/foo.pid'
self.pidfile_timeout = 5
def run(self):
server = WSGIServer(('localhost',28080),handle_request)
server.serve_forever()
if __name__ == '__main__':
app = App()
daemon_runner = runner.DaemonRunner(app)
daemon_runner.do_action()
然而,這給我的錯誤:
[warn] Epoll ADD(1) on fd 5 failed. Old events were 0; read change was 1 (add); write change was 0 (none): Invalid argument
Traceback (most recent call last):
File "enrollmentrunner2.py", line 110, in <module>
daemon_runner.do_action()
File "/usr/lib/python2.7/dist-packages/daemon/runner.py", line 186, in do_action
func(self)
File "/usr/lib/python2.7/dist-packages/daemon/runner.py", line 131, in _start
self.app.run()
File "enrollmentrunner2.py", line 105, in run
server.serve_forever()
File "/usr/lib/python2.7/dist-packages/gevent/baseserver.py", line 188, in serve_forever
self.start()
File "/usr/lib/python2.7/dist-packages/gevent/baseserver.py", line 149, in start
self.start_accepting()
File "/usr/lib/python2.7/dist-packages/gevent/server.py", line 99, in start_accepting
self._accept_event = core.read_event(self.socket.fileno(), self._do_accept, persist=True)
File "core.pyx", line 308, in gevent.core.read_event.__init__ (gevent/core.c:3960)
File "core.pyx", line 252, in gevent.core.event.add (gevent/core.c:2952)
IOError: [Errno 22] Invalid argument
我在網上找了警告,我到處都找不到它,錯誤並沒有真正給我太多有用的信息。我已經運行在這裏描述https://stackoverflow.com/a/9047339的程序,我只是把它在主等單獨運行的程序,。但是,當我將它們結合起來,似乎把事情搞得一團糟。有人知道這可能是爲什麼嗎?