带有主管的多进程Daphne,在非套接字上获得[Errno 88]套接字操作

问题描述 投票:0回答:1

daphne和Django通道可以在命令行或单个进程上正常工作。但是当我用主管启动它时,会发生错误。

2020-02-18 12:40:35,995 CRITICAL Listen failure: [Errno 88] Socket operation on non-socket

我的配置文件是

[program:asgi]

socket=tcp://localhost:9000

directory=/root/test/test/

command=daphne -u /run/daphne/daphne%(process_num)d.sock --endpoint fd:fileno=0 --access-log - --proxy-headers test.asgi:application

# Number of processes to startup, roughly the number of CPUs you have
numprocs=2

# Give each process a unique name so they can be told apart
process_name=asgi%(process_num)d

# Automatically start and recover processes
autostart=true
autorestart=true

# Choose where you want your log to go
stdout_logfile=/root/test/test/script/asgi.log
redirect_stderr=true

[supervisord]
[supervisorctl]

有什么想法吗?谢谢!

django supervisord channels daphne
1个回答
0
投票

[似乎是Python或Twisted无法结合到文件描述符0的错误,如此处所引用:https://github.com/django/daphne/issues/263

[尝试将套接字绑定到另一个fd,像这样说10:daphne -u /run/daphne/daphne%(process_num)d.sock --fd 10 --access-log - --proxy-headers test.asgi:application

如果不起作用,请尝试检查您是否具有对/ run / daphne /文件夹本身的读写访问权限

© www.soinside.com 2019 - 2024. All rights reserved.