Skip to content

Commit

Permalink
safe bash based remote_process_exists
Browse files Browse the repository at this point in the history
  • Loading branch information
Vladimir Krylov committed Dec 28, 2014
1 parent 20b887a commit 011bdf9
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions lib/capistrano/unicorn/utility.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 011bdf9

Please sign in to comment.