[Mongrel] Why not ignore stale PID files?

Zed A. Shaw zedshaw at zedshaw.com
Fri Jun 6 01:01:32 EDT 2008

On Thu, 5 Jun 2008 16:08:06 -0500
Gunnar Wolf <gwolf at gwolf.org> wrote:

> What should happen? Well, 'status' already found that there is a stale
> PID. Of course, the 'status' action means exactly that: Get the
> status, do nothing else. But the 'stop' action should clean the PIDs
> if they do no longer exist, and the 'start' action should check
> whether the process with that PID is alive, and ignore it if it's
> not. At least, this behaviour should be specifiable via the
> configuration file.

That would be the ideal situation, but Ruby doesn't have good enough
process management APIs to do this portably.  To make it work you'd
have to portably be able to take a PID and see if there's a mongrel
running with that PID.

You can't use /proc or /sys because that's linux only.  You can't use
`ps` because the OSX morons changed everything, Solaris has different
format, etc.

If you were to do this, you'd have to dip into C code to pull it off.

Now, if you're only on linux then you could write yourself a small
little hack to the mongrel_rails script that did this with info out
of /proc.

Zed A. Shaw
- Hate: http://savingtheinternetwithhate.com/
- Good: http://www.zedshaw.com/
- Evil: http://yearofevil.com/

More information about the Mongrel-users mailing list