As a work around, I can simply kill the mongrel processes before the init.d script is called. This allows the init.d script to still be used to start/stop the processes on the server directly, but handles the bogus case when mongrel is running and Chef tries to restart the service. Chef handles starting the service correctly as long as the .pid files don't already exist.
To do that, I included the following immediately before the service "myapp" do
call:
ruby_block "stop mongrel" do
block do
ports = ["10031", "10032", "10033"].each do |port|
path = "/path/to/myapp/shared/pids/mongrel.#{port}.pid"
if File.exists?(path)
file = File.open(path, "r")
pid = file.read
file.close
system("kill #{pid}")
File.delete(path) if File.exists?(path)
end
end
end
end