Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Names #10

Merged
merged 2 commits into from Feb 28, 2012
Jump to file or symbol
Failed to load files and symbols.
+5 −3
Split
@@ -14,7 +14,7 @@ def remote_file_exists?(full_path)
# Check if process is running
#
- def process_exists?(pid_file)
+ def remote_process_exists?(pid_file)
capture("ps -p $(cat #{pid_file}) ; true").strip.split("\n").size == 2
end
@@ -49,7 +49,7 @@ def process_exists?(pid_file)
desc 'Stop Unicorn'
task :stop, :roles => :app, :except => {:no_release => true} do
if remote_file_exists?(unicorn_pid)
- if process_exists?(unicorn_pid)
+ if remote_process_exists?(unicorn_pid)
logger.important("Stopping...", "Unicorn")
run "#{try_sudo} kill `cat #{unicorn_pid}`"
else
@@ -64,7 +64,7 @@ def process_exists?(pid_file)
desc 'Unicorn graceful shutdown'
task :graceful_stop, :roles => :app, :except => {:no_release => true} do
if remote_file_exists?(unicorn_pid)
- if process_exists?(unicorn_pid)
+ if remote_process_exists?(unicorn_pid)
logger.important("Stopping...", "Unicorn")
run "#{try_sudo} kill -s QUIT `cat #{unicorn_pid}`"
else
@@ -91,6 +91,8 @@ def process_exists?(pid_file)
end
end
end
+
+ task :restart => :reload
end
after "deploy:restart", "unicorn:reload"