mirror of
https://github.com/puma/puma.git
synced 2022-11-09 13:48:40 -05:00
Wait parameter for stop --force which waits for the pid to go away, and then kill -9 after the wait time.
git-svn-id: svn+ssh://rubyforge.org/var/svn/mongrel/trunk@472 19e92222-5c0b-0410-8929-a290d50e31e9
This commit is contained in:
parent
198a592fca
commit
363c3ba2a1
1 changed files with 8 additions and 2 deletions
|
@ -174,7 +174,8 @@ module Mongrel
|
|||
def configure
|
||||
options [
|
||||
['-c', '--chdir PATH', "Change to dir before starting (will be expanded).", :@cwd, "."],
|
||||
['-f', '--force', "Force the shutdown.", :@force, false],
|
||||
['-f', '--force', "Force the shutdown (kill -9).", :@force, false],
|
||||
['-w', '--wait SECONDS', "Wait SECONDS before forcing shutdown", :@wait, "0"],
|
||||
['-P', '--pid FILE', "Where the PID file is located.", :@pid_file, "log/mongrel.pid"]
|
||||
]
|
||||
end
|
||||
|
@ -191,7 +192,12 @@ module Mongrel
|
|||
|
||||
def run
|
||||
if @force
|
||||
Mongrel::send_signal("KILL", @pid_file)
|
||||
@wait.to_i.times do |waiting|
|
||||
exit(0) if not File.exist? @pid_file
|
||||
sleep 1
|
||||
end
|
||||
|
||||
Mongrel::send_signal("KILL", @pid_file) if File.exist? @pid_file
|
||||
else
|
||||
Mongrel::send_signal("TERM", @pid_file)
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue