# Mongrel server keeps shutting down

**URL:** <https://www.ruby-forum.com/t/mongrel-server-keeps-shutting-down/91231>\
**Category:** Deployment\
**Created:** [April 5, 2007, 8:41pm UTC](https://www.ruby-forum.com/t/mongrel-server-keeps-shutting-down/91231 "2007-04-05T20:41:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![taylorstrait](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/b5a626/32.png) [@taylorstrait](https://www.ruby-forum.com/u/taylorstrait)\
**Post date:** [April 5, 2007, 8:41pm UTC](https://www.ruby-forum.com/t/mongrel-server-keeps-shutting-down/91231/1 "2007-04-05T20:41:47Z")

</div>

(sorry for the cross-post, I accidentally posted this to the rails  
forum)

I’m on a VPS running CentOS. I startup my server with:

mongrel\_rails start -d -p 3000 -e production

and it runs for a while. But later I receive ‘502 Bad Gateway’ errors  
implying my mongrel has crapped out. So in the console I do this:

[prompt]# mongrel\_rails start -d -p 3000 -e production

\*\* !!! PID file log/mongrel.pid already exists. Mongrel could be  
running already. Check your log/mongrel.log for errors.  
\*\* !!! Exiting with error. You must stop mongrel and clear the .pid  
before I’ll attempt a start.

[prompt]# mongrel\_rails stop

Sending TERM to Mongrel at PID 1298…Process does not exist. Not  
running.  
Done.

So I have to manually delete log/mongrel.pid to be able to restart the  
service. log/mongrel.log shows no errors. How can I:

1. find out why mongrel is failing
2. stop mongrel\_rails from failing?
3. make it restart automatically

---

<div class="post-metadata">

**Author:** ![taylorstrait](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/b5a626/32.png) [@taylorstrait](https://www.ruby-forum.com/u/taylorstrait)\
**Post date:** [April 5, 2007, 10:25pm UTC](https://www.ruby-forum.com/t/mongrel-server-keeps-shutting-down/91231/2 "2007-04-05T22:25:38Z")

</div>

On 4/5/07, Taylor S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> So I have to manually delete log/mongrel.pid to be able to restart the  
> service. log/mongrel.log shows no errors. How can I:
> 
> 1. find out why mongrel is failing
> 2. stop mongrel\_rails from failing?

For pointers on these two, see the Mongrel FAQ, specifically the  
Deployment section:  
[http://mongrel.rubyforge.org/faq.html](http://mongrel.rubyforge.org/faq.html)

HTH,

J.

---

<div class="post-metadata">

**Author:** ![taylorstrait](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/b5a626/32.png) [@taylorstrait](https://www.ruby-forum.com/u/taylorstrait)\
**Post date:** [April 6, 2007, 5:53am UTC](https://www.ruby-forum.com/t/mongrel-server-keeps-shutting-down/91231/3 "2007-04-06T05:53:47Z")

</div>

That was very helpful - thanks!

---

<div class="post-metadata">

**Author:** ![taylorstrait](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/b5a626/32.png) [@taylorstrait](https://www.ruby-forum.com/u/taylorstrait)\
**Post date:** [April 13, 2007, 10:10pm UTC](https://www.ruby-forum.com/t/mongrel-server-keeps-shutting-down/91231/4 "2007-04-13T22:10:19Z")

</div>

Hello, I’m having the same problem… I read the mongrel faq and went  
as far as trying to install monit on my shared account at  
railsplayground, only to find out they don’t support it (yet).

so for now I need a cron job and a shell script to do this… would  
anybody have one to share? my system scripting skills are null, and I  
haven’t found any examples on the web yet

thanks  
Oliver

2007/4/5, Jordan K. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):
