mirror of
https://github.com/gitlabhq/gitlab-recipes.git
synced 2026-01-09 14:37:57 -05:00
- Do not use a target to specify dependencies. - Added postgresql and mysqld as optional dependencies. The service files work if the user has installed mysql or postgres either. - Removed ExecStop in gitlab-unicorn.service. It is entirely wrong to do it in such a way, see [1] - Added daemonize flags as it fixes systemd errors and warnings. Without this flags I was not able to start/stop a service properly because systemd has caught the wrong MainPIDs. Furthermore I had problems with service timouts as systemd caught the wrong return codes and considered the services as failed. - Updated README.md. [1]: http://lists.freedesktop.org/archives/systemd-devel/2014-January/016417.html
GitLab startup services for systemd (Archlinux, Fedora, etc)
GitLab requires a couple of services:
- Web server (apache, nginx, etc.)
- Redis server
- Mail server (postfix or other)
- GitLab Sidekiq service (
gitlab-sidekiq.service) - Unicorn service (
gitlab-unicorn.service)
Setup GitLab services
Copy files to /etc/systemd/system/:
sudo su
cd /etc/systemd/system/
wget -O gitlab-sidekiq.service https://gitlab.com/gitlab-org/gitlab-recipes/raw/master/init/systemd/gitlab-sidekiq.service
wget -O gitlab-unicorn.service https://gitlab.com/gitlab-org/gitlab-recipes/raw/master/init/systemd/gitlab-unicorn.service
Reload systemd:
sudo systemctl daemon-reload
Start the services:
sudo systemctl start gitlab-sidekiq.service gitlab-unicorn.service
Enable them to start at boot:
sudo systemctl enable gitlab-sidekiq.service gitlab-unicorn.service
Notes
-
If you installed GitLab in other path than
/home/git/gitlabchange the service files accordingly. -
/etc/systemd/system/have a higher precedence over/usr/lib/systemd/system.