systemd
Hi!
I use archlinux and, as you known, he very love systemd :)
I found some recipes about systemd and gitlab: https://gitlab.com/gitlab-org/gitlab-recipes/tree/a3b249e4f893615b12d41aebe38ce8394d8f4b32/init/systemd but unfortunately this manual didn't work:
wget -O gitlab.target https://raw.github.com/gitlabhq/gitlab-recipes/master/init/systemd/gitlab.target
--2015-09-18 01:09:15-- https://raw.github.com/gitlabhq/gitlab-recipes/master/init/systemd/gitlab.target
Resolving raw.github.com (raw.github.com)... 185.31.17.133
Connecting to raw.github.com (raw.github.com)|185.31.17.133|:443... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: https://raw.githubusercontent.com/gitlabhq/gitlab-recipes/master/init/systemd/gitlab.target [following]
--2015-09-18 01:09:16-- https://raw.githubusercontent.com/gitlabhq/gitlab-recipes/master/init/systemd/gitlab.target
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.31.17.133
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.31.17.133|:443... connected.
HTTP request sent, awaiting response... 404 Not Found
2015-09-18 01:09:16 ERROR 404: Not Found.
anyway, this recipe is stale, because since(I guess) 8.0 version gitlab use one more backend server for git repositories - gitlab-git-http-server...
Currently I use a SystemV gitlab script in systemd script(ugly and stupid way, but works):
[Unit]
Description = GitLab
After = local-fs.target network.target
[Service]
Type = oneshot
User = git
Group = git
WorkingDirectory = /home/git/gitlab
ExecStart = /usr/bin/bash -c 'export PATH=$PATH:~/.gem/ruby/2.2.0/bin && lib/support/init.d/gitlab start'
ExecStop = /usr/bin/bash -c 'export PATH=$PATH:~/.gem/ruby/2.2.0/bin && lib/support/init.d/gitlab stop'
ExecReload = /usr/bin/bash -c 'export PATH=$PATH:~/.gem/ruby/2.2.0/bin && lib/support/init.d/gitlab reload'
RemainAfterExit = yes
[Install]
WantedBy=multi-user.target
01:23[root@somehost.com:/etc/systemd/system]# systemctl status gitlab
● gitlab.service - GitLab
Loaded: loaded (/etc/systemd/system/gitlab.service; enabled; vendor preset: disabled)
Active: active (exited) since Fri 2015-09-18 01:03:19 MSK; 20min ago
Process: 1810 ExecStart=/usr/bin/bash -c export PATH=$PATH:~/.gem/ruby/2.2.0/bin && lib/support/init.d/gitlab start (code=exited, status=0/SUCCESS)
Main PID: 1810 (code=exited, status=0/SUCCESS)
CGroup: /system.slice/gitlab.service
├─1829 unicorn_rails master -D -c /home/git/gitlab/config/unicorn.rb -E production
├─1836 unicorn_rails worker[0] -D -c /home/git/gitlab/config/unicorn.rb -E production
├─1839 unicorn_rails worker[1] -D -c /home/git/gitlab/config/unicorn.rb -E production
├─1842 unicorn_rails worker[2] -D -c /home/git/gitlab/config/unicorn.rb -E production
├─1845 unicorn_rails worker[3] -D -c /home/git/gitlab/config/unicorn.rb -E production
├─1863 /home/git/gitlab/../gitlab-git-http-server/gitlab-git-http-server -listenUmask 0 -listenNetwork unix -listenAddr /home/git/gitlab/tmp/sockets/gitlab-git-http-serve...
└─1887 sidekiq 3.3.0 gitlab [0 of 25 busy]
Sep 18 01:03:10 somehost.com systemd[1]: Starting GitLab...
Sep 18 01:03:10 somehost.com bash[1810]: Removing stale gitlab-git-http-server pid. This is most likely caused by gitlab-git-http-server crashing the last time it ran.
Sep 18 01:03:10 somehost.com bash[1810]: Starting GitLab Unicorn
Sep 18 01:03:10 somehost.com bash[1810]: Starting GitLab Sidekiq
Sep 18 01:03:10 somehost.com bash[1810]: Starting gitlab-git-http-server
Sep 18 01:03:19 somehost.com bash[1810]: The GitLab Unicorn web server with pid 1829 is running.
Sep 18 01:03:19 somehost.com bash[1810]: The GitLab Sidekiq job dispatcher with pid 1887 is running.
Sep 18 01:03:19 somehost.com systemd[1]: Started GitLab.
01:23[root@somehost.com:/etc/systemd/system]#
I'm not sure is it a 100% correct way, but this works for me, perhaps you include something like this in lib/support scripts, because Gtilab Community Edition still does not has any systemd scripts in box!
Kind regards, Andrew B.