From b8667c77c448f09688037426b14a381da99be965 Mon Sep 17 00:00:00 2001 From: Sam Date: Wed, 15 Aug 2018 10:35:24 +1000 Subject: [PATCH] DEV: adjust bin/unicorn to support -p properly --- bin/unicorn | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bin/unicorn b/bin/unicorn index 4bd8e9e7d1e..80f3cca452e 100755 --- a/bin/unicorn +++ b/bin/unicorn @@ -19,6 +19,11 @@ if !ARGV.include?("-E") && Pathname.new(__FILE__).realpath)) end + # we do not want to listen on 2 ports, so lets fix it + if (idx = ARGV.index("-p")) && (port = ARGV[idx + 1].to_i) > 0 + ENV["UNICORN_PORT"] ||= port.to_s + end + ENV["UNICORN_PORT"] ||= "9292" ENV["UNICORN_SIDEKIQS"] ||= "1"