I'm using Chef to manage deployments of a Rails application running with Mongrel cluster.
My init.d
file is very simple. Here's the case for a restart:
restart)
sudo su -l myuser -c "cd /path/to/myapp/current && mongrel_rails cluster::restart"
;;
I can run service myapp restart
as root
with no issue. I can run mongrel_rails cluster::restart
as myuser
with no issue.
However, when I do a deployment through Chef, the tmp/pids/mongrel.port.pid
files don't get cleaned up (causing all future restarts to fail).
Chef is simply doing the following to perform the restart:
service "myapp" do
action :restart
end
The init.d
script is definitely being called as the logs all have the expected output (with the exception of exploding on the pid files, of course).
What am I missing?