解决 Gitlab 13.8.2-ce.0 在 Ubuntu 18.04.5 LTS 上启动失败问题

公司一台ubuntu,装了gitlab-ce简单使用,最近断了两次电gitlab趴窝两次,记录下解决过程

 

1. 机器重启后,启动命令,提示错误

$ sudo gitlab-ctl start

fail: alertmanager: runsv not running
fail: gitaly: runsv not running
fail: gitlab-exporter: runsv not running
fail: gitlab-workhorse: runsv not running
fail: grafana: runsv not running
fail: logrotate: runsv not running
fail: nginx: runsv not running
fail: node-exporter: runsv not running
fail: postgres-exporter: runsv not running
fail: postgresql: runsv not running
fail: prometheus: runsv not running
fail: puma: runsv not running
fail: redis: runsv not running
fail: redis-exporter: runsv not running
fail: sidekiq: runsv not running

2.搜索网络,基本都是

$ sudo gitlab-ctl reconfigure
$ sudo systemctl restart gitlab-runsvdir

这里我执行reconfigure后启动无效

直接启动 runsvdir 会卡住,freeze,看stack overflow上说可以先清理下进程

$ sudo killall runsvdir

测试无效,没有这个进程

3. 搜素到

https://www.taodudu.cc/news/show-2105759.html

2.2.1 参考gitlab官方文档 gitlab-runsvdir not starting

https://docs.gitlab.com/omnibus/common_installation_problems/#gitlab-runsvdir-not-starting

2.2.2 执行systemctl -t target 有dead字段

yfgitlab@ubuntu:~$systemctl -t target
................
multi-user.target      loaded inactive dead   start Multi-User System //执行命令以后有dead
............

2.2.3 执行systemctl list-jobs

yfgitlab@ubuntu:~$ systemctl list-jobs
JOB UNIT                                 TYPE  STATE  
  2 multi-user.target                    start waiting
  1 graphical.target                     start waiting
139 gitlab-runsvdir.service              start waiting
162 ureadahead-stop.timer                start waiting
140 plymouth-quit-wait.service           start running   //这里有一个running,官方建议卸载,然后gitlab就能启动了
 26 setvtrgb.service                     start waiting
129 system-getty.slice                   start waiting
156 systemd-update-utmp-runlevel.service start waiting

In this case, consider uninstalling Plymouth (官方文档解决办法)
执行sudo  apt remove  plymouth 删掉这个应用

他说官方建议卸载,但是提供的官方链接并没有看到这一项,

Since GitLab 11.2, the gitlab-runsvdir starts during the multi-user.target instead 
of basic.target. If you are having trouble starting this service after upgrading 
GitLab, you may need to check that your system has properly booted all the required 
services for multi-user.target via the command:

systemctl -t target

看起来和上一篇介绍的版本不同,

然后查 Plymouth 是什么 

Plymouth is the most commonly used bootsplash program on Linux systems. It supports showing background images, animations and effects during the boot process. Graphics are drawn using either Direct Rendering Manager or Kernel Mode-Setting framebuffer drivers. Plymouth and the theme files are packed into the initrd image. There are hundreds of themes to choose between even though GNU/Linux distributions tend to only come with one or two.

Plymouth can also handle user interaction such as root partition password entry at boot.

看起来是桌面ubuntu的支持,应该是不能卸载的,那么可能是这个服务和gitlab服务的启动顺序导致问题,然后继续搜索

然后搜索到   https://askubuntu.com/questions/766973/how-to-uninstall-plymouth

Plymouth is well-integrated into Ubuntu, and removing it could get difficult. Fortunately, you don't need to remove plymouth in order to disable it; there's a GRUB boot option called splash that can toggle the graphical boot screen on or off.

To disable graphical boot in Ubuntu, you need to open your /etc/default/grub file for editing, with superuser privileges. Under regular Ubuntu, this can be accomplished with:

$ sudo gedit /etc/default/grub
(on a command-line-only system or any other Ubuntu variant, open a terminal and type sudo nano /etc/default/grub instead.)

Locate the GRUB_CMDLINE_LINUX_DEFAULT line in /etc/default/grub , it might look like:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
Then remove the splash from this line, so it looks like the following:

GRUB_CMDLINE_LINUX_DEFAULT="quiet"
Save the file and exit the editor.

Finally, to apply your changes, open a terminal and run:

sudo update-grub
Now your system should boot in text mode, without the graphical boot screen.

disable掉这个服务后,

$ sudo shutdown -r now

重新启动,看起来一切正常了。

  • 2
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值