# Rails processes ignore SIGTERM (kill)?

**URL:** <https://www.ruby-forum.com/t/rails-processes-ignore-sigterm-kill/50588>\
**Category:** Rails\
**Created:** [November 12, 2005, 10:34pm UTC](https://www.ruby-forum.com/t/rails-processes-ignore-sigterm-kill/50588 "2005-11-12T22:34:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![andreas](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ee7513/32.png) [@andreas](https://www.ruby-forum.com/u/andreas)\
**Post date:** [November 12, 2005, 10:34pm UTC](https://www.ruby-forum.com/t/rails-processes-ignore-sigterm-kill/50588/1 "2005-11-12T22:34:01Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![andreas](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ee7513/32.png) [@andreas](https://www.ruby-forum.com/u/andreas)\
**Post date:** [November 13, 2005, 1:38pm UTC](https://www.ruby-forum.com/t/rails-processes-ignore-sigterm-kill/50588/2 "2005-11-13T13:38:28Z")

</div>

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](http://dev.rubyonrails.org/changeset/2847)

---

<div class="post-metadata">

**Author:** ![andreas](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ee7513/32.png) [@andreas](https://www.ruby-forum.com/u/andreas)\
**Post date:** [November 13, 2005, 2:27pm UTC](https://www.ruby-forum.com/t/rails-processes-ignore-sigterm-kill/50588/3 "2005-11-13T14:27:52Z")

</div>

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.
