diff options
Diffstat (limited to 'lib/support/systemd')
-rw-r--r-- | lib/support/systemd/gitlab-gitaly.service | 17 | ||||
-rw-r--r-- | lib/support/systemd/gitlab-mailroom.service | 19 | ||||
-rw-r--r-- | lib/support/systemd/gitlab-pages.service | 19 | ||||
-rw-r--r-- | lib/support/systemd/gitlab-puma.service | 26 | ||||
-rw-r--r-- | lib/support/systemd/gitlab-sidekiq.service | 22 | ||||
-rw-r--r-- | lib/support/systemd/gitlab-workhorse.service | 21 | ||||
-rw-r--r-- | lib/support/systemd/gitlab.slice | 8 | ||||
-rw-r--r-- | lib/support/systemd/gitlab.target | 6 |
8 files changed, 138 insertions, 0 deletions
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 |