Rails processes ignore SIGTERM (kill)?


#1

Hello,

I’ve got a process that loads the environment, does some maintenace work
and sleep()s a few minutes before it starts again. The problem is that I
can’t kill the process with SIGTERM, I need kill -9 (SIGKILL). I noticed
the same with webrick and FastCGI handlers. Why?

Andreas


#2

On 12-nov-2005, at 22:34, removed_email_address@domain.invalid wrote:

Hello,

I’ve got a process that loads the environment, does some maintenace
work
and sleep()s a few minutes before it starts again. The problem is
that I
can’t kill the process with SIGTERM, I need kill -9 (SIGKILL). I
noticed
the same with webrick and FastCGI handlers. Why?

It was designed to shutdown “after the next request” when it recieves
TERM.
Sure enough, it was not recieving this request after lighttpd (or
another FCGI manager) was stopped,
therefore it just kept hanging there. This should have been fixed in
the SVN.
http://dev.rubyonrails.org/changeset/2847


#3

listbox wrote:

On 12-nov-2005, at 22:34, removed_email_address@domain.invalid wrote:

Hello,

I’ve got a process that loads the environment, does some maintenace
work
and sleep()s a few minutes before it starts again. The problem is
that I
can’t kill the process with SIGTERM, I need kill -9 (SIGKILL). I
noticed
the same with webrick and FastCGI handlers. Why?

It was designed to shutdown “after the next request” when it recieves
TERM.

I have the problem not only with FastCGI handlers, but also with normal
Rails maintenance processes that do not handle any requests. Still
trying to figure out why this happens.