当启动/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...
> w1.bot_server@community.net: 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 allowed
看来问题出在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吗?