make mongrel cleanup stale pidfiles
a fix, in /usr/local/lib/ruby/gems/1.8/gems/mongrel-x.x.x/bin/mongrel_rails:
if File.exist? defaults[:pid_file]
# mongrels that crash can leave stale PID files behind, and these
# should not stop mongrel from being restarted by monitors...
pid = File.new(defaults[:pid_file]).readline
unless `ps -ef | grep #{pid} | grep -v grep`.length > 0
# use "ps ax" for freebsd
log "!!! PID file #{defaults[:pid_file]} exists, but is stale, and will be deleted so that this mongrel can run."
File.delete(defaults[:pid_file])
else
log "!!! PID file #{defaults[:pid_file]} already exists and the process id referred to in it is running. This mongrel is probably already running. #{defaults[:log_file]} for errors. EXITING."
exit 1
end
end
there is a call to at_exit in mongrel, which should be cleaning these files up.. but is not.