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:
parent
f9fc59bb7e
commit
274350a2e6
1 changed files with 31 additions and 23 deletions
|
@ -173,7 +173,12 @@ module Puma
|
||||||
begin
|
begin
|
||||||
Process.getpgid pid
|
Process.getpgid pid
|
||||||
rescue SystemCallError
|
rescue SystemCallError
|
||||||
raise "No pid '#{pid}' found"
|
if @options[:command] == "restart"
|
||||||
|
@options.delete(:command)
|
||||||
|
start
|
||||||
|
else
|
||||||
|
raise "No pid '#{pid}' found"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
case @options[:command]
|
case @options[:command]
|
||||||
|
@ -202,20 +207,7 @@ module Puma
|
||||||
end
|
end
|
||||||
|
|
||||||
def run
|
def run
|
||||||
if @options[:command] == "start"
|
start 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
|
|
||||||
|
|
||||||
prepare_configuration
|
prepare_configuration
|
||||||
|
|
||||||
|
@ -229,5 +221,21 @@ module Puma
|
||||||
message e.message
|
message e.message
|
||||||
exit 1
|
exit 1
|
||||||
end
|
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
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue