Php – Gearman workers still running after the job server and Supervisor have been shutdown

gearmanPHPsupervisord

I have shutdown Gearman, using the (echo shutdown ; sleep 0.1) | netcat 127.0.0.1 4730 -w 1 command. I've also stopped Supervisor using /etc/init.d/supervisord stop. However, when I run a ps -aux, there are Gearman workers still running (i.e. /usr/bin/php gearmanworker.php). If i try to kill the worker, a new one is spawned immediately afterwards. Is there another database or something I must wipe to properly shutdown Gearman and its workers?

Any help is much appreciated – thanks!

Best Answer

The fact that the workers are getting respawned hints that supervisord is probably still running. Good chance the /etc/init.d script isn't working for some reason. Try to kill it with

sudo killall supervisord

Then check with

ps aux | grep supervisord

Another useful trick is

sudo supervisorctl

Which if it works means your supervisord is running, and lets you do all sorts of things with it.