mirror of
https://github.com/discourse/discourse.git
synced 2024-11-24 18:54:13 +08:00
33 lines
716 B
Plaintext
33 lines
716 B
Plaintext
|
#!/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)
|
||
|
.reject{|pid| pid == Process.pid}
|
||
|
|
||
|
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')
|