diff --git a/systemd/README.md b/systemd/README.md new file mode 100644 index 0000000..93df404 --- /dev/null +++ b/systemd/README.md @@ -0,0 +1,20 @@ +## GitLab startup services for systemd (CentOS, Fedora) + +GitLab requires couple of services: +* Web server (apache, nginx, etc.) +* Redis server +* Mail server (postfix or other) +* GitLab Sidekiq service (`sidekiq.service`) + + +## Setup GitLab Sidekiq service +1. simply copy* `sidekiq.service` to `/etc/systemd/system/default.target.wants/` (or can to `multi-user.target.wants`) +2. reload systemd: `systemctl --system daemon-reload` +3. `systemctl start sidekiq` (for older systemd versions you would need `systemctl start sidekiq.service`) + +`*` - if you've gitlab in other path than `/home/gitlab/gitlab` then change `sidekiq.service` accordinaly. + + +####Note +`/etc/systemd/system/` have a higher precedence over `/lib/systemd/system` + diff --git a/systemd/sidekiq.service b/systemd/sidekiq.service new file mode 100644 index 0000000..559884e --- /dev/null +++ b/systemd/sidekiq.service @@ -0,0 +1,20 @@ +# +# GITLAB +# Maintainer: @davispuh +# App Version: 4.1 +# +[Unit] +Description=GitLab Sidekiq Service +After=syslog.target network.target remote-fs.target nss-lookup.target redis.service +Wants=redis.service + +[Service] +Type=simple +PIDFile=/home/gitlab/gitlab/tmp/pids/sidekiq.pid +WorkingDirectory=/home/gitlab/gitlab/ +ExecStart=/bin/su - gitlab -c "bundle exec rake sidekiq:start RAILS_ENV=production" +ExecStop=/bin/su - gitlab -c "bundle exec rake sidekiq:stop RAILS_ENV=production" + +[Install] +WantedBy=multi-user.target +