无法杀死Supervisor启动的芹菜流程

dal*_*nns 3 celery supervisord

我正在使用Ubuntu 14.04在Digital Ocean上运行VPS.

我设置主管运行bash脚本来导出环境变量,然后启动芹菜:

#!/bin/bash

DJANGODIR=/webapps/myproj/myproj

# Activate the virtual environment
cd $DJANGODIR
source ../bin/activate

export REDIS_URL="redis://localhost:6379"

...

celery -A connectshare worker --loglevel=info --concurrency=1
Run Code Online (Sandbox Code Playgroud)

现在我注意到,当我执行supervisorctl停止时,主管似乎并没有杀死这些进程.此外,当我尝试手动杀死进程时,他们不会停止.如何为主管设置更好的脚本?如何终止正在运行的进程?

Rya*_*hou 8

您应该将stopasgroup=true选项配置到supervisord.conf文件中.

因为您不仅要杀死父进程,还要杀死子进程.

  • 为我工作,但在supervisord.conf中添加intsead我必须将它添加到conf.d中的[program:]配置中. (3认同)

dan*_*ula 5

发送kill -9必须杀死进程。如果supervisorctl stop还没有停止,您可以尝试设置stopsignal其他值之一,例如QUITKILL

您可以在主管文档中看到更多信息