如果程序不在 init.d 中,它在 CentOS 中的哪个位置在启动时启动?

Pie*_*reF 7 centos upstart init gitlab

我在 CentOS 上安装了一个软件(GitLab)。它运行良好,但是这个 GitLab 在启动时启动,我不想要那样。所以我查看了一下/etc/init.d以禁用它chkconfig,但我的问题是其中没有gitlab脚本,所以我无法禁用它。

所以这是我的问题:在 CentOS 中还有其他地方可以找到在 CentOS 启动时执行的程序吗?或者更直接地说,如果有人知道如何在不使用的情况下从启动时禁用 GitLab init.d,我很感兴趣!

小智 5

编辑upstart文件/etc/init/gitlab-runsvdir.conf并注释掉该行start on runlevel [2345]

结果文件/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
Run Code Online (Sandbox Code Playgroud)

该行start on level [2345]基本上是说脚本/opt/gitlab/embedded/bin/runsvdir-start将在运行级别2、3、4 和 5 上执行

注释掉之后,您仍然可以使用以下命令管理服务:

start gitlab-runsvdir # start the gitlab service

stop gitlab-runsvdir # stop the gitlab service

status gitlab-runsvdir # get status of gitlab service