summaryrefslogtreecommitdiff
path: root/lib/support/init.d/gitlab
diff options
context:
space:
mode:
Diffstat (limited to 'lib/support/init.d/gitlab')
-rwxr-xr-xlib/support/init.d/gitlab13
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/support/init.d/gitlab b/lib/support/init.d/gitlab
index 982c1dc8866..5e8e2ab9c25 100755
--- a/lib/support/init.d/gitlab
+++ b/lib/support/init.d/gitlab
@@ -27,6 +27,7 @@
### Environment variables
RAILS_ENV="production"
USE_UNICORN=""
+SIDEKIQ_WORKERS=1
# Script variable names should be lower-case not to conflict with
# internal /bin/sh variables such as PATH, EDITOR or SHELL.
@@ -36,7 +37,6 @@ 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"
-sidekiq_pid_path="$pid_path/sidekiq.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)
@@ -74,6 +74,11 @@ else
use_web_server="unicorn"
fi
+if [ -z "$SIDEKIQ_WORKERS" ]; then
+ sidekiq_pid_path="$pid_path/sidekiq.pid"
+else
+ sidekiq_pid_path="$pid_path/sidekiq-cluster.pid"
+fi
### Init Script functions
@@ -295,7 +300,7 @@ start_gitlab() {
if [ "$sidekiq_status" = "0" ]; then
echo "The Sidekiq job dispatcher is already running with pid $spid, not restarting"
else
- RAILS_ENV=$RAILS_ENV bin/background_jobs start &
+ RAILS_ENV=$RAILS_ENV SIDEKIQ_WORKERS=$SIDEKIQ_WORKERS bin/background_jobs start &
fi
if [ "$gitlab_workhorse_status" = "0" ]; then
@@ -354,7 +359,7 @@ stop_gitlab() {
fi
if [ "$sidekiq_status" = "0" ]; then
echo "Shutting down GitLab Sidekiq"
- RAILS_ENV=$RAILS_ENV bin/background_jobs stop
+ RAILS_ENV=$RAILS_ENV SIDEKIQ_WORKERS=$SIDEKIQ_WORKERS bin/background_jobs stop
fi
if [ "$gitlab_workhorse_status" = "0" ]; then
echo "Shutting down GitLab Workhorse"
@@ -458,7 +463,7 @@ reload_gitlab(){
echo "Done."
echo "Restarting GitLab Sidekiq since it isn't capable of reloading its config..."
- RAILS_ENV=$RAILS_ENV bin/background_jobs restart
+ RAILS_ENV=$RAILS_ENV SIDEKIQ_WORKERS=$SIDEKIQ_WORKERS bin/background_jobs restart
if [ "$mail_room_enabled" != true ]; then
echo "Restarting GitLab MailRoom since it isn't capable of reloading its config..."