Gitlab 开机自动启动

Gitlab autostart on boot

首先我为我的英语感到抱歉。

我最近在 Debian 7.1 服务器上安装了 GitLab,但没有开机启动。我检查了 /etc/init.d,但是没有 Gitlab 的脚本。

如何将 Gitlab 添加到启动中?

我使用了下载页面上的 Omnibus deb 安装程序,如果我 运行 "gitlab-ctl start" 工作完美。

问候和感谢!!

在 CentOS 7 上, 有一个符号link,

/etc/systemd/system/default.target.wants/gitlab-runsvdir.service -> /opt/gitlab/embedded/cookbooks/runit/files/default/gitlab-runsvdir.service

而gitlab-runsvdir.service的内容是这样的

[Unit] Description=GitLab Runit supervision process

[Service] ExecStart=/opt/gitlab/embedded/bin/runsvdir-start
Restart=always

我希望 Debian 7 中有类似的东西。

这对我不起作用, 找到答案很烦人:

有效的是:

在 Centos 6.7 上: 编辑 upstart 文件 /etc/init/gitlab-runsvdir.conf 并注释掉以下行:

start on runlevel [2345]

systemctl enable gitlab-runsvdir

如果您的系统正在使用 systemd (RHEL/CentOS 7) 而不是 init;这更容易:)

 [meebo@server ~]# sudo systemctl enable gitlab-runsvdir
 Created symlink from /etc/systemd/system/basic.target.wants/gitlab-
 runsvdir.service to /usr/lib/systemd/system/gitlab-runsvdir.service.

如果您的发行版正在使用 systemd,那么您可以使用以下方法检查服务是否实际可用(或确保名称正确):

systemctl list-units | grep gitlab

然后启用并启动它:

systemctl enable gitlab-runner.service
systemctl start gitlab-runner.service

相关文档https://docs.gitlab.com/runner/configuration/init.html