diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-05-20 17:34:42 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-05-20 17:34:42 +0300 |
commit | 9f46488805e86b1bc341ea1620b866016c2ce5ed (patch) | |
tree | f9748c7e287041e37d6da49e0a29c9511dc34768 /lib/support | |
parent | dfc92d081ea0332d69c8aca2f0e745cb48ae5e6d (diff) |
Add latest changes from gitlab-org/gitlab@13-0-stable-ee
Diffstat (limited to 'lib/support')
-rwxr-xr-x | lib/support/init.d/gitlab | 26 | ||||
-rw-r--r-- | lib/support/init.d/gitlab.default.example | 6 |
2 files changed, 17 insertions, 15 deletions
diff --git a/lib/support/init.d/gitlab b/lib/support/init.d/gitlab index 5e8e2ab9c25..8e9f220ec85 100755 --- a/lib/support/init.d/gitlab +++ b/lib/support/init.d/gitlab @@ -23,11 +23,20 @@ # An example defaults file can be found in lib/support/init.d/gitlab.default.example ### - ### Environment variables -RAILS_ENV="production" -USE_UNICORN="" -SIDEKIQ_WORKERS=1 +RAILS_ENV=${RAILS_ENV:-'production'} +SIDEKIQ_WORKERS=${SIDEKIQ_WORKERS:-1} +USE_WEB_SERVER=${USE_WEB_SERVER:-'puma'} + +case "${USE_WEB_SERVER}" in + puma|unicorn) + use_web_server="$USE_WEB_SERVER" + ;; + *) + echo "Unsupported web server '${USE_WEB_SERVER}' (Allowed: 'puma', 'unicorn')" 1>&2 + exit 1 + ;; +esac # Script variable names should be lower-case not to conflict with # internal /bin/sh variables such as PATH, EDITOR or SHELL. @@ -36,7 +45,7 @@ app_root="/home/$app_user/gitlab" pid_path="$app_root/tmp/pids" socket_path="$app_root/tmp/sockets" rails_socket="$socket_path/gitlab.socket" -web_server_pid_path="$pid_path/unicorn.pid" +web_server_pid_path="$pid_path/$use_web_server.pid" mail_room_enabled=false mail_room_pid_path="$pid_path/mail_room.pid" gitlab_workhorse_dir=$(cd $app_root/../gitlab-workhorse 2> /dev/null && pwd) @@ -67,13 +76,6 @@ if ! cd "$app_root" ; then echo "Failed to cd into $app_root, exiting!"; exit 1 fi -# Select the web server to use -if [ -z "$USE_UNICORN" ]; then - use_web_server="puma" -else - use_web_server="unicorn" -fi - if [ -z "$SIDEKIQ_WORKERS" ]; then sidekiq_pid_path="$pid_path/sidekiq.pid" else diff --git a/lib/support/init.d/gitlab.default.example b/lib/support/init.d/gitlab.default.example index bb271b16836..1b499467ad6 100644 --- a/lib/support/init.d/gitlab.default.example +++ b/lib/support/init.d/gitlab.default.example @@ -6,7 +6,7 @@ RAILS_ENV="production" # Uncomment the line below to enable the Unicorn web server instead of Puma. -# USE_UNICORN=1 +# use_web_server="unicorn" # app_user defines the user that GitLab is run as. # The default is "git". @@ -26,8 +26,8 @@ pid_path="$app_root/tmp/pids" socket_path="$app_root/tmp/sockets" # web_server_pid_path defines the path in which to create the pid file fo the web_server -# The default is "$pid_path/unicorn.pid" -web_server_pid_path="$pid_path/unicorn.pid" +# The default is "$pid_path/puma.pid" +web_server_pid_path="$pid_path/puma.pid" # sidekiq_pid_path defines the path in which to create the pid file for sidekiq # The default is "$pid_path/sidekiq.pid" |