in lib/puma/control_cli.rb [195:247]
def send_signal
unless @pid
raise "Neither pid nor control url available"
end
begin
case @command
when "restart"
Process.kill "SIGUSR2", @pid
when "halt"
Process.kill "QUIT", @pid
when "stop"
Process.kill "SIGTERM", @pid
when "stats"
puts "Stats not available via pid only"
return
when "reload-worker-directory"
puts "reload-worker-directory not available via pid only"
return
when "phased-restart"
Process.kill "SIGUSR1", @pid
when "status"
begin
Process.kill 0, @pid
puts "Puma is started"
rescue Errno::ESRCH
raise "Puma is not running"
end
return
else
return
end
rescue SystemCallError
if @command == "restart"
start
else
raise "No pid '#{@pid}' found"
end
end
message "Command #{@command} sent success"
end