diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-05-22 06:10:39 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-05-22 06:10:39 +0300 |
commit | 729d26fafca3390ad44d7d41efca872e9ff0c716 (patch) | |
tree | 5969f0afec9cd33a70dba2e07ba4a9fc7ebea9e5 /bin | |
parent | 5ef38f2a1dec97fad5cc2d1b6934c4049a7dac6f (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/web | 61 | ||||
-rwxr-xr-x | bin/web_puma | 63 | ||||
-rwxr-xr-x | bin/web_unicorn | 59 |
3 files changed, 52 insertions, 131 deletions
@@ -3,18 +3,61 @@ set -e cd $(dirname $0)/.. +app_root=$(pwd) -case "$USE_WEB_SERVER" in - puma|"") # and the "" defines default - exec bin/web_puma "$@" - ;; +puma_pidfile="$app_root/tmp/pids/puma.pid" +puma_config="$app_root/config/puma.rb" - unicorn) - exec bin/web_unicorn "$@" - ;; +spawn_puma() +{ + exec bundle exec puma --config "${puma_config}" --environment "$RAILS_ENV" "$@" +} - *) - echo "Unkown web server used by USE_WEB_SERVER: $USE_WEB_SERVER." +get_puma_pid() +{ + pid=$(cat "${puma_pidfile}") + if [ -z "$pid" ] ; then + echo "Could not find a PID in $puma_pidfile" exit 1 + fi + echo "${pid}" +} + +start() +{ + spawn_puma & +} + +start_foreground() +{ + spawn_puma +} + +stop() +{ + get_puma_pid + kill -INT "$(get_puma_pid)" +} + +reload() +{ + kill -USR2 "$(get_puma_pid)" +} + +case "$1" in + start) + start + ;; + start_foreground) + start_foreground + ;; + stop) + stop + ;; + reload) + reload + ;; + *) + echo "Usage: RAILS_ENV=your_env $0 {start|stop|reload}" ;; esac diff --git a/bin/web_puma b/bin/web_puma deleted file mode 100755 index c1ab4718f0d..00000000000 --- a/bin/web_puma +++ /dev/null @@ -1,63 +0,0 @@ -#!/bin/sh - -set -e - -cd $(dirname $0)/.. -app_root=$(pwd) - -puma_pidfile="$app_root/tmp/pids/puma.pid" -puma_config="$app_root/config/puma.rb" - -spawn_puma() -{ - exec bundle exec puma --config "${puma_config}" --environment "$RAILS_ENV" "$@" -} - -get_puma_pid() -{ - pid=$(cat "${puma_pidfile}") - if [ -z "$pid" ] ; then - echo "Could not find a PID in $puma_pidfile" - exit 1 - fi - echo "${pid}" -} - -start() -{ - spawn_puma & -} - -start_foreground() -{ - spawn_puma -} - -stop() -{ - get_puma_pid - kill -INT "$(get_puma_pid)" -} - -reload() -{ - kill -USR2 "$(get_puma_pid)" -} - -case "$1" in - start) - start - ;; - start_foreground) - start_foreground - ;; - stop) - stop - ;; - reload) - reload - ;; - *) - echo "Usage: RAILS_ENV=your_env $0 {start|stop|reload}" - ;; -esac diff --git a/bin/web_unicorn b/bin/web_unicorn deleted file mode 100755 index 5fa15a8324b..00000000000 --- a/bin/web_unicorn +++ /dev/null @@ -1,59 +0,0 @@ -#!/bin/sh - -cd $(dirname $0)/.. || exit 1 -app_root=$(pwd) - -unicorn_pidfile="$app_root/tmp/pids/unicorn.pid" -unicorn_config="$app_root/config/unicorn.rb" -unicorn_cmd="bundle exec unicorn_rails -c $unicorn_config -E $RAILS_ENV" - -get_unicorn_pid() -{ - local pid - pid=$(cat $unicorn_pidfile) - if [ -z "$pid" ] ; then - echo "Could not find a PID in $unicorn_pidfile" - exit 1 - fi - unicorn_pid=$pid -} - -start() -{ - exec $unicorn_cmd -D -} - -start_foreground() -{ - exec $unicorn_cmd -} - -stop() -{ - get_unicorn_pid - kill -QUIT $unicorn_pid -} - -reload() -{ - get_unicorn_pid - kill -USR2 $unicorn_pid -} - -case "$1" in - start) - start - ;; - start_foreground) - start_foreground - ;; - stop) - stop - ;; - reload) - reload - ;; - *) - echo "Usage: RAILS_ENV=your_env $0 {start|stop|reload}" - ;; -esac |