Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Foreman does not kill processes

For start application i use Foreman. Foreman start process from Procfile

web: bundle exec rails server thin -p $PORT
worker: bundle exec rake environment resque:work QUEUE=send_mail
api: bundle exec rails server thin -p $PORT

If i press control+C in console where i run foreman, foreman is ended but ran process is not killed. Is it possible to kill process that foreman ran when foreman killed.

like image 500
Oksana Avatar asked Nov 12 '11 15:11

Oksana


2 Answers

Example below assumes port used is 4567, then do:

lsof -i :4567

This gives you the pid of the process, say 34564, then kill it with

kill -9 34564

If you are on windows, install cygwin to get lsof and kill commands.

like image 82
ftravers Avatar answered Sep 21 '22 21:09

ftravers


Thin doesn't terminate as long as there are open connections. Faye uses long-polling or WebSockets (long lasting connections). So the end result is that Thin is waiting for your Faye connections to close.

Try to turn of the signal handlers installed by Thin and you should be fine.

like image 22
simonmenke Avatar answered Sep 21 '22 21:09

simonmenke