环境: linux 7.x gitlab开源(自己安装)
背景: 为给公司自己部署一个git服务。 在一台阿里云服务器上安装了gitlab。
gitlab 会安装很多东西,包括 redis, postgresql, puma 等等。 由于后来在另一台服务器上安装了gitlab, 这台服务器上的gitlab就要关闭掉。
kill gitlab 进程
方法一:
su
ps -ef |grep gitlab |awk '{print $2}'|xargs kill -9
方法二:
gitlab-ctl stop
两种方式都尝试后,发现依旧还有很多进程活跃。
其中,执行以下命令:
ps -ef | grep gitlab
显示的进程中有一个进程:
runsvdir -P /opt/gitlab/service log
这是一个runit service,kill -9 无法杀死。【runsvdir 进程杀死后又重新创建(杀不死)】
后来查看了官方文档中的说明后, 使用如下命令:
systemctl stop gitlab-runsvdir
然后
ps -ef | grep gitlab
发现跟gitlab相关的进程都关闭了。
内存也释放了。
free -mh
参考文章:
Common installation problems
https://docs.gitlab.com/omnibus/common_installation_problems/#gitlab-runsvdir-not-starting