generators/vulcanize/templates/mongrel/config/rubber/deploy-mongrel.rb in sml-rubber-0.9.13 vs generators/vulcanize/templates/mongrel/config/rubber/deploy-mongrel.rb in sml-rubber-1.5.5
- old
+ new
@@ -10,28 +10,28 @@
task :custom_install, :roles => :mongrel do
# Setup system to restart mongrel_cluster on reboot
rubber.sudo_script 'setup_mongrel_init', <<-ENDSCRIPT
mkdir -p /etc/mongrel_cluster
rm -f /etc/mongrel_cluster/#{application}-#{RUBBER_ENV}.yml && ln -s /mnt/#{application}-#{RUBBER_ENV}/current/config/mongrel_cluster.yml /etc/mongrel_cluster/#{application}-#{RUBBER_ENV}.yml
- find /usr/lib/ruby/gems -path "*/resources/mongrel_cluster" -exec cp {} /etc/init.d/ \\;
+ find #{rubber_env.rvm_version ? "$(rvm gemdir)" : "/usr/lib/ruby/gems"} -path "*/resources/mongrel_cluster" -exec cp {} /etc/init.d/ \\;
chmod +x /etc/init.d/mongrel_cluster
update-rc.d -f mongrel_cluster remove
update-rc.d mongrel_cluster defaults 99 00
ENDSCRIPT
end
def mongrel_stop
- run "cd #{current_path} && mongrel_rails cluster::stop"
+ rsudo "cd #{current_path} && mongrel_rails cluster::stop"
sleep 5 # Give the graceful stop a chance to complete
- run "cd #{current_path} && mongrel_rails cluster::stop --force --clean"
+ rsudo "cd #{current_path} && mongrel_rails cluster::stop --force --clean"
end
def mongrel_start
- run "cd #{current_path} && mongrel_rails cluster::start --clean"
+ rsudo "cd #{current_path} && mongrel_rails cluster::start --clean"
pid_cnt = rubber_env.mongrel_count
logger.info "Waiting for mongrel pid files to show up"
- run "while ((`ls #{current_path}/tmp/pids/mongrel.*.pid 2> /dev/null | wc -l` < #{pid_cnt})); do sleep 1; done"
+ rsudo "while ((`ls #{current_path}/tmp/pids/mongrel.*.pid 2> /dev/null | wc -l` < #{pid_cnt})); do sleep 1; done"
end
# serial_task can only be called after roles defined - not normally a problem, but
# rubber auto-roles don't get defined till after all tasks are defined
on :load do