omnibus-gitlab/files/gitlab-cookbooks/gitlab/templates/default/sv-sidekiq-run.erb

39 lines
1.5 KiB
Plaintext

#!/bin/sh
cd <%= node['gitlab']['gitlab_rails']['dir'] %>/working
exec 2>&1
<%= render("make_metrics_rundir.erb", cookbook: 'gitlab') %>
<%= render("mount_point_check.erb", cookbook: 'gitlab') %>
rubyopt="-W:no-experimental"
exec chpst -e /opt/gitlab/etc/gitlab-rails/env -P \
-U <%= @options[:user] %>:<%= @options[:groupname] %> \
-u <%= @options[:user] %>:<%= @options[:groupname] %> \
/usr/bin/env \
RUBYOPT="${rubyopt}" \
prometheus_multiproc_dir="${prometheus_run_dir}" \
/opt/gitlab/embedded/service/gitlab-rails/bin/sidekiq-cluster \
-e <%= node['gitlab']['gitlab_rails']['environment'] %> \
-r /opt/gitlab/embedded/service/gitlab-rails \
<% if node['gitlab']['sidekiq']['interval'] %>
-i <%= node['gitlab']['sidekiq']['interval'] %> \
<% end %>
<% if node['gitlab']['sidekiq']['concurrency'] %>
-c <%= node['gitlab']['sidekiq']['concurrency'] %> \
<% end %>
<% if node['gitlab']['sidekiq']['max_concurrency'] %>
-m <%= node['gitlab']['sidekiq']['max_concurrency'] %> \
<% end %>
<% if node['gitlab']['sidekiq']['min_concurrency'] %>
--min-concurrency <%= node['gitlab']['sidekiq']['min_concurrency'] %> \
<% end %>
<% if node['gitlab']['sidekiq']['shutdown_timeout'] %>
--timeout <%= node['gitlab']['sidekiq']['shutdown_timeout'] %> \
<% end %>
<% node['gitlab']['sidekiq']['queue_groups'].each do |queue| %>
"<%= queue %>" \
<% end %>
# Do not remove this line; it prevents trouble with the trailing backslashes above.