运行Daemon出错,Traceback如下:
Traceback (most recent call last):
File "monitor.py", line 46, in
daemon_runner = runner.DaemonRunner(app)
File "/home/tim/anaconda3/lib/python3.6/site-packages/daemon/runner.py", line 118, in __init__
self.daemon_context.stdout = open(app.stdout_path, 'w+t')
io.UnsupportedOperation: File or stream is not seekable.
原因是Python3.0对IO的限制,解决办法为:
打开vi /home/tim/anaconda3/lib/python3.6/site-packages/daemon/runner.py
在118行,119行修改,黑体部分为修改处。
elf.daemon_context.stdout = open(app.stdout_path, 'wb+',buffering=0)
self.daemon_context.stderr = open(app.stderr_path, 'wb+', buffering=0)