def send_signal
unless pid = @options[:pid]
raise "Neither pid nor control url available"
end
begin
Process.getpgid pid
rescue SystemCallError
raise "No pid '#{pid}' found"
end
case @options[: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 "phased-restart"
Process.kill "SIGUSR1", pid
else
message "Puma is started"
return
end
message "Command #{@options[:command]} sent success"
end