Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't kill celery processes started by Supervisor

I am running a VPS on Digital Ocean with Ubuntu 14.04.

I setup supervisor to run a bash script to export environment vars and then start celery:

#!/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

Now I've noticed that supervisor does not seem to be killing these processes when I do supervisorctl stop. Furthermore, when I try to manually kill the processes they won't stop. How can I set up a better script for supervisor and how can I kill the processes that are running?

like image 940
dallinns Avatar asked Dec 02 '22 19:12

dallinns


1 Answers

You should configurate the stopasgroup=true option into supervisord.conf file.

Because you just not only kill the parent process but also the child process.

like image 163
Ryan Chou Avatar answered Mar 11 '23 20:03

Ryan Chou