Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sidekiq service file for systemd (CentOS, Fedora) #43

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
20 changes: 20 additions & 0 deletions 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`

20 changes: 20 additions & 0 deletions 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