FreeBSD 上有适用于 Celery 的有效 rc 脚本吗?
我已经在 FreeBSD 上编写了一个 celeryd 的 rc 脚本,但我忍不住认为一定有更好的方法。 celeryd 本身不会守护进程,而且它似乎也很难响应 sigterm,因此工作起来可能很复杂。
这是别人以前解决过的问题吗?
I have hacked together an rc script for celeryd on FreeBSD, but I can't help but think that there must be a better way. celeryd
does not daemonize itself, and it seems to have a hard time responding to sigterm as well, so it might be complicated to get to work.
Is this a problem that someone else has solved before?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这里有一个实验性的 init.d 脚本:
https://github.com/ask/celery/tree/ master/contrib/generic-init.d/
我不知道它是否已经在 FreeBSD 上测试过,但绝对应该制作
在那里工作。
celeryd 没有响应
TERM
是什么意思?这是推荐信号用于干净关闭,因为它将完成所有当前正在运行的任务。
(没有超时,所以如果你有一个任务陷入僵局,这没有帮助,因为你可能会
使用 --time-limit 参数)
这是我使用的
/etc/default/celeryd
文件(它用于 Django 项目,对于其他项目,只需将manage.py celeryd
替换为celeryd):http://pastie.org/1216111
celerybeat
/celeryevcam
正在使用contrib/debian/init.d
中的脚本,目前还没有这些脚本的通用版本。There's an experimental init.d script here:
https://github.com/ask/celery/tree/master/contrib/generic-init.d/
I don't know if it has been tested on FreeBSD, but it should definitely be made
to work there.
What do you mean celeryd isn't responding to
TERM
? This is the recommended signalto use for a clean shutdown as it will finish any currently running tasks.
(there's no time out, so it doesn't help if you have a task in deadlock, for that you may
use the --time-limit argument)
Here's the
/etc/default/celeryd
file I use (it's for a Django project, for others just replacemanage.py celeryd
withceleryd
):http://pastie.org/1216111
celerybeat
/celeryevcam
is using the scripts fromcontrib/debian/init.d
, there are no generic versions of these yet.