discourse/bin/puma

33 lines
719 B
Plaintext
Raw Normal View History

2017-05-15 09:08:51 -04:00
#!/usr/bin/env ruby
#
# This file was generated by Bundler.
#
# The application 'puma' is installed as part of a gem, and
# this file is here to facilitate running it.
#
if ARGV[0] == '--kill-existing'
ARGV.delete_at(0)
pids = `ps aux | grep puma | grep discourse | grep -v grep | awk '{print $2;}'`.strip
.split("\n")
.map(&:to_i)
2017-07-27 21:20:09 -04:00
.reject { |pid| pid == Process.pid }
2017-05-15 09:08:51 -04:00
if pids.length > 0
STDERR.puts "Terminating old version of puma at pid #{pids[0]}"
`kill -9 #{pids[0]}`
sleep 1
end
end
require 'pathname'
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
Pathname.new(__FILE__).realpath)
require 'rubygems'
require 'bundler/setup'
load Gem.bin_path('puma', 'puma')