Found this thread searching the archives, after running into this same
problem. Anyone know why this hasn’t been added to mongrel_cluster trunk
yet? Very annoying. Or maybe it has been, but just wasn’t in the distro
I got?
Problem is if your server/mongrels dies ungracefully, then
/etc/init.d/mongrel_cluster won’t succesfully start up your mongrels
again, since there are stale pids.
[email protected] wrote:
oops, this is actually what I am running now (again patched into /usr/
lib/ruby/gems/1.8/gems/mongrel-1.0.1/bin/mongrel_rails)
if File.exist? defaults[:pid_file]
#===== new stuff
pid = File.new(defaults[:pid_file]).readline
if `ps --pid #{pid} --no-headers`.length > 0
log "!!! PID file #{defaults[:pid_file]} already
exists and the process id referenced is running. This mongrel is
probably already running. #{defaults[:log_file]} for errors.
EXITING."
exit 1
else
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])
end
#===== old stuff
#log “!!! PID file #{defaults[:pid_file]} already exists.
Mongrel could be running already. Check your #{defaults[:log_file]}
for errors.”
#log “!!! Exiting with error. You must stop mongrel and
clear the .pid before I’ll attempt a start.”
end