1
0
Fork 0
mirror of https://github.com/puma/puma.git synced 2022-11-09 13:48:40 -05:00

make pumactl restart start puma if not running

This commit is contained in:
Tim McEwan 2013-08-01 20:04:44 +10:00
parent f9fc59bb7e
commit 274350a2e6

View file

@ -173,8 +173,13 @@ module Puma
begin
Process.getpgid pid
rescue SystemCallError
if @options[:command] == "restart"
@options.delete(:command)
start
else
raise "No pid '#{pid}' found"
end
end
case @options[:command]
when "restart"
@ -202,20 +207,7 @@ module Puma
end
def run
if @options[:command] == "start"
require 'puma/cli'
run_args = @argv
if path = @options[:status_path]
run_args = ["-S", path] + run_args
end
events = Puma::Events.new @stdout, @stderr
cli = Puma::CLI.new run_args, events
cli.run
return
end
start if @options[:command] == "start"
prepare_configuration
@ -229,5 +221,21 @@ module Puma
message e.message
exit 1
end
private
def start
require 'puma/cli'
run_args = @argv
if path = @options[:status_path]
run_args = ["-S", path] + run_args
end
events = Puma::Events.new @stdout, @stderr
cli = Puma::CLI.new run_args, events
cli.run
return
end
end
end