Skip to content

A platform for community discussion. Free, open, simple.

DEV: Check `RUN_PITCHFORK` for explicit "1" value (#37264)

Alan Guo Xiang Tan63023145c2b7
diff --git a/bin/rails b/bin/rails
index 5db3b992db0..aa8b01ab7f3 100755
--- a/bin/rails
+++ b/bin/rails
@@ -10,7 +10,7 @@ if !ENV["RAILS_ENV"] && (ARGV[0] == "s" || ARGV[0] == "server") && Process.respo
ENV["RAILS_LOGS_STDOUT"] ||= "1"
- exec File.expand_path(ENV["RUN_PITCHFORK"] ? "pitchfork" : "unicorn", __dir__)
+ exec File.expand_path(ENV["RUN_PITCHFORK"] == "1" ? "pitchfork" : "unicorn", __dir__)
end
APP_PATH = File.expand_path("../config/application", __dir__)
diff --git a/config/unicorn_launcher b/config/unicorn_launcher
index 5a4363fc99e..92955f53b01 100755
--- a/config/unicorn_launcher
+++ b/config/unicorn_launcher
@@ -69,7 +69,7 @@ function on_reopenlogs() {
export UNICORN_SUPERVISOR_PID=$$
-if [[ -n "$RUN_PITCHFORK" ]]; then
+if [[ "$RUN_PITCHFORK" == "1" ]]; then
PITCHFORK_ARGS=()
for arg in "$@"; do
PITCHFORK_ARGS+=("${arg/unicorn.conf.rb/pitchfork.conf.rb}")
@@ -77,7 +77,7 @@ if [[ -n "$RUN_PITCHFORK" ]]; then
fi
trap on_exit EXIT
-if [[ -z "$RUN_PITCHFORK" ]]; then
+if [[ "$RUN_PITCHFORK" != "1" ]]; then
trap on_reload_unicorn USR2 HUP
trap on_reopenlogs USR1
unicorn "$@" &