# Mongrel PID Issues

**URL:** <https://www.ruby-forum.com/t/mongrel-pid-issues/106569>\
**Category:** Rails\
**Created:** [June 12, 2007, 1:52am UTC](https://www.ruby-forum.com/t/mongrel-pid-issues/106569 "2007-06-12T01:52:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kwest](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/a4c791/32.png) [@kwest](https://www.ruby-forum.com/u/kwest)\
**Post date:** [June 12, 2007, 1:52am UTC](https://www.ruby-forum.com/t/mongrel-pid-issues/106569/1 "2007-06-12T01:52:04Z")

</div>

I finally got my app to deploy using Capistrano, but now I cannot get  
Mongrel to run on the server this is the error I keep getting:

!! PID file log/mongrel.8000.pid does not exist

---

<div class="post-metadata">

**Author:** ![kwest](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/a4c791/32.png) [@kwest](https://www.ruby-forum.com/u/kwest)\
**Post date:** [June 12, 2007, 2:08am UTC](https://www.ruby-forum.com/t/mongrel-pid-issues/106569/2 "2007-06-12T02:08:05Z")

</div>

On Mon, 2007-06-11 at 23:50 +0000, kwest wrote:

> I finally got my app to deploy using Capistrano, but now I cannot get  
> Mongrel to run on the server this is the error I keep getting:
> 
> !! PID file log/mongrel.8000.pid does not exist

* * *

try making the ‘log’ directory writable for everyone…

chmod g+w,o+w log

–  
Craig W. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![kwest](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/a4c791/32.png) [@kwest](https://www.ruby-forum.com/u/kwest)\
**Post date:** [June 12, 2007, 3:07am UTC](https://www.ruby-forum.com/t/mongrel-pid-issues/106569/3 "2007-06-12T03:07:09Z")

</div>

On Jun 11, 2007, at 8:06 PM, Craig W. wrote:

> –  
> Craig W. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

I found that the defaults for the location of the PID files seemed to  
differ between start and stop. I “solved” that problem by specifying  
the exact (relative) location of the pid file for both startup and  
shutdown. The parts of my /etc/init.d/mongrel file are below:

function startup() {  
host=127.0.0.1  
for port in 8000 8001 8002; do  
mongrel\_rails start --daemonize -e production --port $port -  
a $host --pid tmp/pids/mongrel.${port}.pid -c ${1:-$BASEDIR}  
done  
}

function shutdown() {  
cd ${1:-BASEDIR}  
for pidfile in tmp/pids/mongrel\*.pid; do  
mongrel\_rails stop --pid $pidfile -c ${1:-$BASEDIR}  
done  
}

I hope this helps you. You might also look at mongrel-cluster (as I  
should one day) to manage a pack of mongrels.

-Rob

Rob B. [http://agileconsultingllc.com](http://agileconsultingllc.com)  
removed\_email\_address@domain.invalid
