Browse files

Merge pull request #17 from mifix/master

call remote_process_exists instead of process_exists
  • Loading branch information...
2 parents 24296c3 + 85a211e commit 1d78e2444a6a7dccab846e4c40fd6332e28144dd @sosedoff committed Apr 23, 2012
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/capistrano-unicorn/capistrano_integration.rb
View
6 lib/capistrano-unicorn/capistrano_integration.rb
@@ -10,7 +10,7 @@ def self.load_into(capistrano_config)
def remote_file_exists?(full_path)
'true' == capture("if [ -e #{full_path} ]; then echo 'true'; fi").strip
end
-
+
# Check if process is running
#
def remote_process_exists?(pid_file)
@@ -46,7 +46,7 @@ def unicorn_send_signal(pid, signal)
desc 'Start Unicorn master process'
task :start, :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("Unicorn is already running!", "Unicorn")
next
else
@@ -60,7 +60,7 @@ def unicorn_send_signal(pid, signal)
else
config_path = "#{current_path}/config/unicorn/#{unicorn_env}.rb"
end
-
+
if remote_file_exists?(config_path)
logger.important("Starting...", "Unicorn")
run "cd #{current_path} && BUNDLE_GEMFILE=#{current_path}/Gemfile bundle exec #{unicorn_bin} -c #{config_path} -E #{app_env} -D"

0 comments on commit 1d78e24

Please sign in to comment.