我有几个 Upstart 服务,希望在 Gitlab 启动后也能启动它们,准备服务存储库秒。
有一个gitlab-runsvdir
Upstart 服务(随gitlab
软件包提供)可以在启动时启动 Gitlab,但是使用
start on started gitlab-runsvdir
没有证明有帮助,因为当该服务启动时 Gitlab 仍然没有准备好。
当 Gitlab 准备好为存储库提供服务时,如何设置 Upstart 服务?
/etc/init/gitlab-runsvdir.conf
根据要求, 的内容:
start on runlevel [2345]
stop on shutdown
respawn
post-stop script
# To avoid stomping on runsv's owned by a different runsvdir
# process, kill any runsv process that has been orphaned, and is
# now owned by init (process 1).
pkill -HUP -P 1 runsv$
end script
exec /opt/gitlab/embedded/bin/runsvdir-start
据我所知,这是随gitlab
包裹附带的。
答案1
尝试 gitlab-ctl。你可以在以下路径找到它:
/usr/bin/gitlab-ctl
/opt/gitlab/bin/gitlab-ctl
例如
exec /usr/bin/gitlab-ctl start
exec /usr/bin/gitlab-ctl stop