diff --git a/lib/capistrano/unicorn/utility.rb b/lib/capistrano/unicorn/utility.rb index 3870ac8..d31f8ef 100644 --- a/lib/capistrano/unicorn/utility.rb +++ b/lib/capistrano/unicorn/utility.rb @@ -40,11 +40,7 @@ def working_directory(path); end # Check if a remote process exists using its pid file # def remote_process_exists?(pid_file) - begin - execute(*try_unicorn_user, 'kill', '-0', get_unicorn_pid) if within(fetch(:app_path)) { test('[', '-e', pid_file, ']') } - rescue SSHKit::Command::Failed => e - false - end + test("[ -e #{pid_file} ]") && test("ps -p `cat #{pid_file}` > /dev/null") end # Stale Unicorn process pid file