2021-06-01 12:20:20 +00:00
|
|
|
# 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'
|
2020-02-18 19:51:31 +00:00
|
|
|
task :stop do # rubocop:disable Rails/RakeEnvironment
|
2018-10-01 17:41:17 +00:00
|
|
|
|
2020-02-18 19:51:31 +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
|