首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >芹菜不会重新启动子进程

芹菜不会重新启动子进程
EN

Stack Overflow用户
提问于 2015-07-24 12:18:49
回答 1查看 304关注 0票数 0

我对芹菜部署有一个问题--当我重新启动它时,旧的子进程不会停止并继续处理一些作业。我用监督管理芹菜。这是我的配置:

代码语言:javascript
复制
$ cat /etc/supervisor/conf.d/celery.conf 
[program:celery]
; Full path to use virtualenv, honcho to load .env
command=/home/ubuntu/venv/bin/honcho run celery -A stargeo worker -l info --no-color

directory=/home/ubuntu/app
environment=PATH="/home/ubuntu/venv/bin:%(ENV_PATH)s"
user=ubuntu
numprocs=1
stdout_logfile=/home/ubuntu/logs/celery.log
stderr_logfile=/home/ubuntu/logs/celery.err
autostart=true
autorestart=true
startsecs=10

; Need to wait for currently executing tasks to finish at shutdown.
; Increase this if you have very long running tasks.
stopwaitsecs = 600

; When resorting to send SIGKILL to the program to terminate it
; send SIGKILL to its whole process group instead,
; taking care of its children as well.
killasgroup=true

; if rabbitmq is supervised, set its priority higher
; so it starts first
priority=998

这里是芹菜加工的样子:

代码语言:javascript
复制
$ ps axwu | grep celery
ubuntu     983  0.0  0.1  47692 10064 ?        S    11:47   0:00 /home/ubuntu/venv/bin/python /home/ubuntu/venv/bin/honcho run celery -A stargeo worker -l info --no-color
ubuntu     984  0.0  0.0   4440   652 ?        S    11:47   0:00 /bin/sh -c celery -A stargeo worker -l info --no-color
ubuntu     985  0.0  0.5 168720 41356 ?        S    11:47   0:01 /home/ubuntu/venv/bin/python /home/ubuntu/venv/bin/celery -A stargeo worker -l info --no-color
ubuntu     990  0.0  0.4 167936 36648 ?        S    11:47   0:00 /home/ubuntu/venv/bin/python /home/ubuntu/venv/bin/celery -A stargeo worker -l info --no-color
ubuntu     991  0.0  0.4 167936 36648 ?        S    11:47   0:00 /home/ubuntu/venv/bin/python /home/ubuntu/venv/bin/celery -A stargeo worker -l info --no-color

当我运行sudo supervisorctl restart celery时,它只会先停止python ... honcho一个进程,然后所有其他进程继续运行。如果我试图杀死他们,他们会继续(kill -9工作)。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-08-16 10:07:20

这似乎是有洪乔的虫子。最后,我从主管处开始编写这个脚本:

代码语言:javascript
复制
#!/bin/bash

source /home/ubuntu/venv/bin/activate
exec env $(cat .env | grep -v ^# | xargs) \
     celery -A stargeo worker -l info --no-color
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/31610393

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档