Skip to content

Commit

Permalink
Always pass a symbol command to execute and test, so that the right S…
Browse files Browse the repository at this point in the history
…SH user is used
  • Loading branch information
Jordan Hollinger committed Nov 10, 2015
1 parent 1e0a58a commit 05b8924
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/capistrano/tasks/puma.rake
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ namespace :puma do
puma_switch_user(role) do
with rack_env: fetch(:puma_env) do
if test "[ -f #{fetch(:puma_pid)} ]"
if test "kill -0 $( cat #{fetch(:puma_pid)} )"
if test :kill, "-0 $( cat #{fetch(:puma_pid)} )"
execute :pumactl, "-S #{fetch(:puma_state)} -F #{fetch(:puma_conf)} #{command}"
else
# delete invalid pid file , process is not running.
Expand All @@ -103,7 +103,7 @@ namespace :puma do
within current_path do
puma_switch_user(role) do
with rack_env: fetch(:puma_env) do
if test "[ -f #{fetch(:puma_pid)} ]" and test "kill -0 $( cat #{fetch(:puma_pid)} )"
if test "[ -f #{fetch(:puma_pid)} ]" and test :kill, "-0 $( cat #{fetch(:puma_pid)} )"
# NOTE pid exist but state file is nonsense, so ignore that case
execute :pumactl, "-S #{fetch(:puma_state)} -F #{fetch(:puma_conf)} #{command}"
else
Expand Down
4 changes: 2 additions & 2 deletions lib/capistrano/tasks/workers.rake
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace :puma do
task :more do
on roles (fetch(:puma_role)) do |role|
puma_switch_user(role) do
execute("kill -TTIN `cat #{fetch(:puma_pid)}`")
execute(:kill, "-TTIN `cat #{fetch(:puma_pid)}`")
end
end
end
Expand All @@ -30,7 +30,7 @@ namespace :puma do
task :less do
on roles (fetch(:puma_role)) do |role|
puma_switch_user(role) do
execute("kill -TTOU `cat #{fetch(:puma_pid)}`")
execute(:kill, "-TTOU `cat #{fetch(:puma_pid)}`")
end
end
end
Expand Down

0 comments on commit 05b8924

Please # to comment.