From 311b0269b4eb9839fa63f80c8d7a58f32b8138a0 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Thu, 18 Nov 2021 13:16:36 +0000 Subject: Add latest changes from gitlab-org/gitlab@14-5-stable-ee --- lib/support/init.d/gitlab | 8 ++++++-- lib/support/systemd/gitlab-gitaly.service | 17 +++++++++++++++++ lib/support/systemd/gitlab-mailroom.service | 19 +++++++++++++++++++ lib/support/systemd/gitlab-pages.service | 19 +++++++++++++++++++ lib/support/systemd/gitlab-puma.service | 26 ++++++++++++++++++++++++++ lib/support/systemd/gitlab-sidekiq.service | 22 ++++++++++++++++++++++ lib/support/systemd/gitlab-workhorse.service | 21 +++++++++++++++++++++ lib/support/systemd/gitlab.slice | 8 ++++++++ lib/support/systemd/gitlab.target | 6 ++++++ 9 files changed, 144 insertions(+), 2 deletions(-) create mode 100644 lib/support/systemd/gitlab-gitaly.service create mode 100644 lib/support/systemd/gitlab-mailroom.service create mode 100644 lib/support/systemd/gitlab-pages.service create mode 100644 lib/support/systemd/gitlab-puma.service create mode 100644 lib/support/systemd/gitlab-sidekiq.service create mode 100644 lib/support/systemd/gitlab-workhorse.service create mode 100644 lib/support/systemd/gitlab.slice create mode 100644 lib/support/systemd/gitlab.target (limited to 'lib/support') diff --git a/lib/support/init.d/gitlab b/lib/support/init.d/gitlab index 96e3a015115..1ad89fdc364 100755 --- a/lib/support/init.d/gitlab +++ b/lib/support/init.d/gitlab @@ -291,7 +291,9 @@ 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 SIDEKIQ_WORKERS=$SIDEKIQ_WORKERS bin/background_jobs start & + # bin/background_jobs writes to log/sidekiq.log and stdout by + # default, so we just need to suppress the latter here. + RAILS_ENV=$RAILS_ENV SIDEKIQ_WORKERS=$SIDEKIQ_WORKERS bin/background_jobs start > /dev/null & fi if [ "$gitlab_workhorse_status" = "0" ]; then @@ -454,7 +456,9 @@ reload_gitlab(){ echo "Done." echo "Restarting GitLab Sidekiq since it isn't capable of reloading its config..." - RAILS_ENV=$RAILS_ENV SIDEKIQ_WORKERS=$SIDEKIQ_WORKERS bin/background_jobs restart + # bin/background_jobs writes to log/sidekiq.log and stdout by default, + # so we just need to suppress the latter here. + RAILS_ENV=$RAILS_ENV SIDEKIQ_WORKERS=$SIDEKIQ_WORKERS bin/background_jobs restart > /dev/null & if [ "$mail_room_enabled" != true ]; then echo "Restarting GitLab MailRoom since it isn't capable of reloading its config..." diff --git a/lib/support/systemd/gitlab-gitaly.service b/lib/support/systemd/gitlab-gitaly.service new file mode 100644 index 00000000000..49f04563292 --- /dev/null +++ b/lib/support/systemd/gitlab-gitaly.service @@ -0,0 +1,17 @@ +[Unit] +Description=GitLab Gitaly +ReloadPropagatedFrom=gitlab.target +PartOf=gitlab.target +After=network.target + +[Service] +Type=simple +User=git +WorkingDirectory=/home/git/gitlab +ExecStart=/home/git/gitaly/_build/bin/gitaly /home/git/gitaly/config.toml +Restart=on-failure +SyslogIdentifier=gitlab-gitaly +Slice=gitlab.slice + +[Install] +WantedBy=gitlab.target diff --git a/lib/support/systemd/gitlab-mailroom.service b/lib/support/systemd/gitlab-mailroom.service new file mode 100644 index 00000000000..4186126c128 --- /dev/null +++ b/lib/support/systemd/gitlab-mailroom.service @@ -0,0 +1,19 @@ +[Unit] +Description=GitLab Mailroom +PartOf=gitlab.target +After=network.target +StartLimitIntervalSec=100s + +[Service] +Type=simple +User=git +WorkingDirectory=/home/git/gitlab +Environment=RAILS_ENV=production +ExecStart=/usr/local/bin/bundle exec mail_room --log-exit-as json --quiet --config /home/git/gitlab/config/mail_room.yml +Restart=on-failure +RestartSec=1 +SyslogIdentifier=gitlab-mailroom +Slice=gitlab.slice + +[Install] +WantedBy=gitlab.target diff --git a/lib/support/systemd/gitlab-pages.service b/lib/support/systemd/gitlab-pages.service new file mode 100644 index 00000000000..2060f01be01 --- /dev/null +++ b/lib/support/systemd/gitlab-pages.service @@ -0,0 +1,19 @@ +[Unit] +Description=GitLab Pages +ReloadPropagatedFrom=gitlab.target +PartOf=gitlab.target +After=network.target gitlab-puma.service +Wants=gitlab-puma.service + +[Service] +Type=simple +User=git +WorkingDirectory=/home/git/gitlab +ExecStart=/home/git/gitlab-pages/gitlab-pages -config /home/git/gitlab-pages/gitlab-pages.conf +Restart=on-failure +RestartSec=1 +SyslogIdentifier=gitlab-pages +Slice=gitlab.slice + +[Install] +WantedBy=gitlab.target diff --git a/lib/support/systemd/gitlab-puma.service b/lib/support/systemd/gitlab-puma.service new file mode 100644 index 00000000000..c0affa92ddf --- /dev/null +++ b/lib/support/systemd/gitlab-puma.service @@ -0,0 +1,26 @@ +[Unit] +Description=GitLab +Conflicts=gitlab.service +ReloadPropagatedFrom=gitlab.target +PartOf=gitlab.target +After=network.target +StartLimitIntervalSec=100s + +[Service] +Type=notify +User=git +WorkingDirectory=/home/git/gitlab +Environment=RAILS_ENV=production +ExecStart=/usr/local/bin/bundle exec puma --config /home/git/gitlab/config/puma.rb --environment production --pidfile /home/git/gitlab/tmp/pids/puma.pid +ExecReload=/usr/bin/kill -USR2 $MAINPID +PIDFile=/home/git/gitlab/tmp/pids/puma.pid +# puma can be slow to start +TimeoutStartSec=120 +WatchdogSec=10 +Restart=on-failure +RestartSec=1 +SyslogIdentifier=gitlab-puma +Slice=gitlab.slice + +[Install] +WantedBy=gitlab.target diff --git a/lib/support/systemd/gitlab-sidekiq.service b/lib/support/systemd/gitlab-sidekiq.service new file mode 100644 index 00000000000..81046f5348a --- /dev/null +++ b/lib/support/systemd/gitlab-sidekiq.service @@ -0,0 +1,22 @@ +[Unit] +Description=GitLab Sidekiq +ReloadPropagatedFrom=gitlab.target +PartOf=gitlab.target +After=network.target +JoinsNamespaceOf=gitlab-puma.service + +[Service] +Type=simple +User=git +WorkingDirectory=/home/git/gitlab +Environment=RAILS_ENV=production +ExecStart=/usr/local/bin/bundle exec sidekiq --config /home/git/gitlab/config/sidekiq_queues.yml --environment production +ExecStop=/usr/local/bin/bundle exec sidekiqctl stop /run/gitlab/sidekiq.pid +PIDFile=/home/git/gitlab/tmp/pids/sidekiq.pid +Restart=on-failure +RestartSec=1 +SyslogIdentifier=gitlab-sidekiq +Slice=gitlab.slice + +[Install] +WantedBy=gitlab.target diff --git a/lib/support/systemd/gitlab-workhorse.service b/lib/support/systemd/gitlab-workhorse.service new file mode 100644 index 00000000000..3e9a72d3cb2 --- /dev/null +++ b/lib/support/systemd/gitlab-workhorse.service @@ -0,0 +1,21 @@ +[Unit] +Description=GitLab Workhorse +ReloadPropagatedFrom=gitlab.target +PartOf=gitlab.target +After=network.target gitlab-puma.service +Wants=gitlab-puma.service + +[Service] +Type=simple +User=git +WorkingDirectory=/home/git/gitlab +Environment=PATH=/home/git/gitlab-workhorse:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin +ExecStart=/home/git/gitlab-workhorse/gitlab-workhorse -listenUmask 0 -listenNetwork unix -listenAddr /home/git/gitlab/tmp/sockets/gitlab-workhorse.socket -authBackend http://127.0.0.1:8080 -authSocket /home/git/gitlab/tmp/sockets/gitlab.socket -documentRoot /home/git/gitlab/public -secretPath /home/git/gitlab/.gitlab_workhorse_secret +ExecReload=/usr/bin/kill -USR2 $MAINPID +Restart=on-failure +RestartSec=1 +SyslogIdentifier=gitlab-workhorse +Slice=gitlab.slice + +[Install] +WantedBy=gitlab.target diff --git a/lib/support/systemd/gitlab.slice b/lib/support/systemd/gitlab.slice new file mode 100644 index 00000000000..2c447f6224a --- /dev/null +++ b/lib/support/systemd/gitlab.slice @@ -0,0 +1,8 @@ +[Unit] +Description=Slice to bundle all GitLab services +Before=slices.target + +[Slice] +MemoryAccounting=true +IOAccounting=true +CPUAccounting=true diff --git a/lib/support/systemd/gitlab.target b/lib/support/systemd/gitlab.target new file mode 100644 index 00000000000..e0538c3ff81 --- /dev/null +++ b/lib/support/systemd/gitlab.target @@ -0,0 +1,6 @@ +[Unit] +Description=GitLab +Wants=gitlab-gitaly.service gitlab-puma.service gitlab-sidekiq.service gitlab-workhorse.service + +[Install] +WantedBy=multi-user.target -- cgit v1.2.1