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

29 lines
557 B
Ruby
Raw Normal View History

# Copyright (C) 2012-2021 Zammad Foundation, http://zammad-foundation.org/
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 # rubocop:disable Rails/RakeEnvironment
2018-10-01 17:41:17 +00:00
file = Rails.root.join('tmp/pids/server.pid')
2018-10-01 17:41:17 +00:00
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