启动/etc/init.d/celeryd时,出现以下错误。我确保所有目录对于启动它的用户都是可读写的。我什至做了touch文件,以确保在所有地方都存在要写入文件的指令。

(community)community@community:~$ /etc/init.d/celeryd  start
bot_server.settings.production
celery multi v3.1.11 (Cipater)
> Starting nodes...
    > [email protected]: Traceback (most recent call last):
  File "/home/community/community-forums/bot_server/manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/home/community/.virtualenvs/community/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 399, in execute_from_command_line
    utility.execute()
  File "/home/community/.virtualenvs/community/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 392, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/home/community/.virtualenvs/community/local/lib/python2.7/site-packages/djcelery/management/commands/celeryd_detach.py", line 26, in run_from_argv
    detached().execute_from_commandline(argv)
  File "/home/community/.virtualenvs/community/local/lib/python2.7/site-packages/celery/bin/celeryd_detach.py", line 160, in execute_from_commandline
    **vars(options)
  File "/home/community/.virtualenvs/community/local/lib/python2.7/site-packages/celery/bin/celeryd_detach.py", line 42, in detach
    with detached(logfile, pidfile, uid, gid, umask, working_directory, fake):
  File "/home/community/.virtualenvs/community/local/lib/python2.7/site-packages/celery/platforms.py", line 383, in detached
    maybe_drop_privileges(uid=uid, gid=gid)
  File "/home/community/.virtualenvs/community/local/lib/python2.7/site-packages/celery/platforms.py", line 520, in maybe_drop_privileges
    initgroups(uid, gid)
  File "/home/community/.virtualenvs/community/local/lib/python2.7/site-packages/celery/platforms.py", line 473, in initgroups
    return os.initgroups(username, gid)
OSError: [Errno 1] Operation not permitted
* Child terminated with errorcode 1
FAILED


我在用:

Django==1.6.3
celery==3.1.11
celerymon==1.0.3
django-celery==3.1.10
django-celery-with-redis==3.0

最佳答案

OSError errno 1看起来像是一个权限问题:
OSError: [Error 1] Operation not permitted

看起来问题出在os.initgroups上,它在系统上调用了initgroups -请参见man initgroups

从您的提示符看来,您正在使用某种角色帐户,我想关于django正在访问的文件如何设置您的角色/组权限存在一些问题。

编辑:
来自man initgroups

DESCRIPTION
   The initgroups() function initializes the group access list by reading
   the group database /etc/group and using all groups of which user is a member.
   The additional group group is also added to the list.


community可以读取/ etc / group吗?

07-24 09:53