trabajo-afectivo/lib/tasks/zammad/ci/service/puma/stop.rake

27 lines
447 B
Ruby
Raw Normal View History

2018-10-01 17:41:17 +00:00
namespace :zammad do
namespace :ci do
namespace :service do
namespace :puma do
desc 'Stops the puma application webserver'
task :stop do
file = Rails.root.join('tmp', 'pids', 'server.pid')
pid = File.read(file).to_i
Process.kill('SIGTERM', pid)
sleep 5
next if !File.exist?(file)
Process.kill('SIGKILL', pid)
end
end
end
end
end