gpt4 book ai didi

Python Celery init.d 脚本 OSError : [Errno 1] Operation not permitted

转载 作者:行者123 更新时间:2023-12-01 05:12:16 25 4
gpt4 key购买 nike

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

(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 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.

社区可以读取/etc/group吗?

关于Python Celery init.d 脚本 OSError : [Errno 1] Operation not permitted,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23921204/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com