I wanted to install gitlab on my local ubuntu server. The installation seemed to hang until I manually started /opt/gitlab/embedded/bin/runsvdir-start
in the background (with &
). I then rebooted the machine to find gitlab is not running and the gitlab-runsvdir.service
is dead:
$ sudo systemctl status gitlab-runsvdir.service
○ gitlab-runsvdir.service - GitLab Runit supervision process
Loaded: loaded (/usr/lib/systemd/system/gitlab-runsvdir.service; enabled; preset: enabled)
Active: inactive (dead)
I wanted to start the service:
sudo systemctl start gitlab-runsvdir.service
but this got stuck and only Ctrl-c
resolved it. The service was of course still dead.
I found a few questions online regarding this:
- Gitlab Cannot start runsv is not running
- Gitlab not starting after upgrade to Ubuntu 18.04
but these do not help and all solutions require restarting the service, which does of course not work, since this is my issue to begin with.
Next, I took a look at the service file:
[Unit]
Description=GitLab Runit supervision process
After=multi-user.target
[Service]
ExecStart=/opt/gitlab/embedded/bin/runsvdir-start
Restart=always
TasksMax=4915
[Install]
WantedBy=multi-user.target
I have to admit, I have never worked with these before and I don't know what to make of this. As mentioned above, starting /opt/gitlab/embedded/bin/runsvdir-start
manually works. I thought this may be a forking issue? I tried this answer, which either did not work or I fot to reload the deamon. Ultimately, this worked:
[Unit]
Description=GitLab Runit supervision process
# After=multi-user.target
[Service]
Type=simple
ExecStart=/opt/gitlab/embedded/bin/runsvdir-start
Restart=always
TasksMax=4915
[Install]
WantedBy=multi-user.target
I have no idea what "After" and "WantedBy" mean here, but in my head this sounded like a deadlock situation, so commenting this out was my next best guess, and it worked?
What is going on here?