Skip to content
This repository has been archived by the owner on Dec 31, 2022. It is now read-only.

Commit

Permalink
fix: do not read pidfile at each stop retry (prevent from early pidfi…
Browse files Browse the repository at this point in the history
…le deletion)

Fixes #163
  • Loading branch information
fpbouchard authored and ajgon committed Jun 22, 2018
1 parent bb04fb4 commit c5f0fe4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions templates/default/appserver.service.erb
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,17 @@ def stop
puts "Stopping <%= @name.capitalize %> #{APP_NAME}"
retries = 10
pid = `cat #{PID_PATH}`
loop do
break if !running? || retries <= 0
run_and_ignore_exitcode_and_print_command "kill -QUIT `cat #{PID_PATH}`"
run_and_ignore_exitcode_and_print_command "kill -QUIT #{pid}"
sleep 1
retries -= 1
end
`rm #{PID_PATH}` if run_and_ignore_exitcode_and_print_command "kill -QUIT `cat #{PID_PATH}`"
`rm #{PID_PATH}` if run_and_ignore_exitcode_and_print_command "kill -QUIT #{pid}"
end
def stop_start
Expand Down

0 comments on commit c5f0fe4

Please sign in to comment.