dallinns
dallinns

Reputation: 152

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?

Upvotes: 6

Views: 9957

Answers (2)

Ryan Chou
Ryan Chou

Reputation: 1132

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.

Upvotes: 13

daniula
daniula

Reputation: 7028

Sending kill -9 have to kill process. If supervisorctl stop doesn't stop your process you can try setting up stopsignal to one of other values, for example QUIT or KILL.

You can see more in supervisord documentation.

Upvotes: 6

Related Questions