错误:CANT_REREAD:名为路径/home/app/logs/celery.log的一部分的目录不存在

时间:2018-04-21 05:42:13

标签: python django celery ubuntu-16.04

我跟随tutorial on how to use Celery on my Django production server

当我说到它的位置时:

Now reread the configuration and add the new process:

    sudo supervisorctl reread
    sudo supervisorctl update 

当我在我的服务器(Ubuntu 16.04)终端中执行sudo supervisorctl reread时,它会返回:

ERROR: CANT_REREAD: 
The directory named as part of the path /home/app/logs/celery.log does not exist. 
in section 'app-celery' (file: '/etc/supervisor/conf.d/app-celery.conf')

我之前已完成所有说明,包括安装supervisor以及在文件夹中创建名为mysite-celery.conf(app-celery.conf)的文件:/ etc / supervisor /conf.d

如果您有点好奇我的app-celery.conf文件如下所示:

[program:app-celery]
command=/home/app/bin/celery worker -A draft1 --loglevel=INFO
directory=/home/app/draft1
user=zorgan
numprocs=1
stdout_logfile=/home/app/logs/celery.log
stderr_logfile=/home/app/logs/celery.log
autostart=true
autorestart=true
startsecs=10

; Need to wait for currently executing tasks to finish at shutdown.
; Increase this if you have very long running tasks.
stopwaitsecs = 600

stopasgroup=true

; Set Celery priority higher than default (999)
; so, if rabbitmq is supervised, it will start first.
priority=1000

知道问题是什么吗?

2 个答案:

答案 0 :(得分:0)

Summer Supervisor无法创建文件夹-/ home / app / logs /。 您可以使用mkdir手动创建它,然后重新启动超级用户服务

mkdir /home/app/logs
sudo service supervisor restart

答案 1 :(得分:0)

我将用户名添加到[unix_http_server]部分下的superisord.conf文件中,如下所示:

[unix_http_server]
file=/var/run/supervisor.sock   ; (the path to the socket file)
chmod=0770                       ; sockef file mode (default 0700)
chown=appuser:supervisor        ;(username:group)

这似乎很正常,可以说明我设法解决了其余主管问题后,它是否继续工作。