desc “Restart the web server”
task :restart, :roles => :app do
run “cd #{current_path}; mongrel_rails cluster::stop -C
#{current_path}/config/mongrel_cluster.yml; cd -”
run “cd #{current_path}; mongrel_rails cluster::start -C
#{current_path}/config/mongrel_cluster.yml; cd -”
end
I’ve tried various other lines, but Mongrel and/or cluster couldn’t find
configs, or logs. And it also seems mongrel_cluster expects to find
configs in /etc/… even if the mongrel_config var is set. Is there a
way to clean up these command lines?
Oh, I also tried using just mongrel_rails cluster::restart, but files
seemed to keep getting served out of the PREVIOUSLY current folder (the
one in which Mongrel was initially started).
Oh, I also tried using just mongrel_rails cluster::restart, but files
seemed to keep getting served out of the PREVIOUSLY current folder (the
one in which Mongrel was initially started).
I can’t remember where I saw that, but Mongrel finds the real
directory from which it is started, and attaches there.
What you have to do is use the -c switch when you configure your
cluster:
When the other cluster tasks read the config file, the first thing
Mongrel will do is CD to the directory in question. So, the symlink
will be refreshed.