权限问题阻止celery作为守护程序运行? [英] Permission problems prevent celery from running as daemon?

查看:108
本文介绍了权限问题阻止celery作为守护程序运行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前在将celery作为守护程序运行时遇到一些麻烦。我使用apache服务我的Django应用程序,因此我在celery中将uid和gid设置为 www-data。到目前为止,我知道有2个需要访问权限的地方: / var / log / celery / *。log / var / run / celery / * .pid ,我已经将它们设置为 www-data所有。但是,当我运行 sudo service celeryd start 时,celery无法启动。如果我删除了该命令的--uid和--gid选项,那么celery可以由用户 root启动。

I'm currently having some trouble running celery as daemon. I use apache to serve my Django application, so I set uid and gid in celery setting all as "www-data". There are 2 places I know so far that need access permission: /var/log/celery/*.log, /var/run/celery/*.pid, and I already set them owned by "www-data". However, celery couldn't get started when I run sudo service celeryd start. If I get rid of the --uid and --gid option for the command, celery could get started by user "root".

我注意到的另一件事是,如果我可以使用 root启动芹菜,它将放置一些文件,例如: celery.bak CELERYD_CHDIR中的code>, celery.dat celery.dir ,这是我的django应用程序目录。我还更改了 www-data所有的应用程序目录,但是celery仍然无法启动。我从另一台运行芹菜的机器上复制了所有设置文件,所以我认为这不是我的设置问题。有人有任何线索吗?谢谢。

One other thing I noticed is that if I could start celery using "root", it will put some files like: celery.bak, celery.dat, celery.dir in my CELERYD_CHDIR, which is my django application directory. I also changed the application directory owned by "www-data", celery still couldn't get started. I copied all the setting files from another machine in which celery runs fine, so I suppose it's not my setting's problem. Does anyone have any clue? Thanks.

推荐答案

Su给celery用户并从命令行启动celery。您最有可能需要获得许可的应用日志,而不是芹菜日志。

Su to celery user and start celery from the command line. Most likely you have an app log, not celery, that you need permission for.

这篇关于权限问题阻止celery作为守护程序运行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆