[Mongrel] Why not ignore stale PID files?
normalperson at yhbt.net
Fri Jun 6 19:18:03 EDT 2008
Gunnar Wolf <gwolf at gwolf.org> wrote:
> Zed A. Shaw dijo [Fri, Jun 06, 2008 at 01:01:32AM -0400]:
> > 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.
> I guess this works in any Unixy environment... I have no idea on
> whether Windows implements something similar to Process.getpgid, or
> for that matter, anything on Windows' process management.
Process.kill(0, pid) also works and is (in my experience) more
More information about the Mongrel-users