标黑的就是关键命令,
先停止gitlab服务,
然后rpm -e卸载,
然后查看剩余gitlab进程,
然后杀死主进程,
然后删除所有相关目录 1 [liuyx@MiWiFi-R3L-srv ~]$ sudo gitlab-ctl stop
[sudo] password for liuyx:
liuyx 不在 sudoers 文件中。此事将被报告。
[liuyx@MiWiFi-R3L-srv ~]$ su root
密码:
[root@MiWiFi-R3L-srv liuyx]# ls -l /etc/sudoers
-r--r-----. root root 6月 : /etc/sudoers
[root@MiWiFi-R3L-srv liuyx]# vim /etc/sudoers
[root@MiWiFi-R3L-srv liuyx]# chmod /etc/sudoers
[root@MiWiFi-R3L-srv liuyx]# vim /etc/sudoers
[root@MiWiFi-R3L-srv liuyx]# chmod /etc/sudoers
[root@MiWiFi-R3L-srv liuyx]# exit
exit
[liuyx@MiWiFi-R3L-srv ~]$ sudo gitlab-ctl stop
[sudo] password for liuyx:
ok: down: gitaly: 1s, normally up
ok: down: gitlab-monitor: 0s, normally up
ok: down: gitlab-workhorse: 1s, normally up
ok: down: logrotate: 0s, normally up
ok: down: nginx: 1s, normally up
ok: down: node-exporter: 0s, normally up
ok: down: postgres-exporter: 0s, normally up
ok: down: postgresql: 0s, normally up
ok: down: prometheus: 1s, normally up, want up
ok: down: redis: 0s, normally up
ok: down: redis-exporter: 1s, normally up
ok: down: sidekiq: 1s, normally up
ok: down: unicorn: 0s, normally up [liuyx@MiWiFi-R3L-srv ~]$ sudo rpm -e gitlab-ce
[sudo] password for liuyx:
[liuyx@MiWiFi-R3L-srv ~]$ ps -ef|grep gitlab
root : ? :: runsvdir -P /opt/gitlab/service log: ...........................................................................................................................................................................................................................................................................................................................................................................................................
root : ? :: runsv gitlab-workhorse
root : ? :: svlogd -tt /var/log/gitlab/gitlab-workhorse
root : ? :: svlogd -tt /var/log/gitlab/logrotate
root : ? :: runsv gitlab-monitor
root : ? :: svlogd -tt /var/log/gitlab/node-exporter
root : ? :: svlogd -tt /var/log/gitlab/nginx
root : ? :: svlogd -tt /var/log/gitlab/unicorn
root : ? :: svlogd -tt /var/log/gitlab/gitaly
root : ? :: svlogd -tt /var/log/gitlab/redis-exporter
root : ? :: svlogd -tt /var/log/gitlab/gitlab-monitor
root : ? :: svlogd -tt /var/log/gitlab/postgresql
root : ? :: svlogd -tt /var/log/gitlab/redis
root : ? :: svlogd -tt /var/log/gitlab/sidekiq
root : ? :: svlogd -tt /var/log/gitlab/prometheus
root : ? :: svlogd -tt /var/log/gitlab/postgres-exporter
liuyx : pts/ :: grep --color=auto gitlab
[liuyx@MiWiFi-R3L-srv ~]$ sudo kill -
[sudo] password for liuyx:
[liuyx@MiWiFi-R3L-srv ~]$ ps -ef|grep gitlab
liuyx : pts/ :: grep --color=auto gitlab [root@MiWiFi-R3L-srv liuyx]# find / -name gitlab
find: ‘/run/user//gvfs’: 权限不够
[root@MiWiFi-R3L-srv liuyx]# rm -rf /run/user//gvfs
rm: 无法删除"/run/user/1000/gvfs": 是一个目录
[root@MiWiFi-R3L-srv liuyx]# umount -rf /run/user//gvfs
[root@MiWiFi-R3L-srv liuyx]# rm -rf /run/user//gvfs
[root@MiWiFi-R3L-srv liuyx]# find / -name gitlab|xargs rm -rf

既然博客园不支持代码中大小写,我还是直接把关键命令单独拉出来吧,不然这排版看着太难受了,前边是上文中的行号:

14 [liuyx@MiWiFi-R3L-srv ~]$ sudo gitlab-ctl stop
30 [liuyx@MiWiFi-R3L-srv ~]$ sudo rpm -e gitlab-ce
32 [liuyx@MiWiFi-R3L-srv ~]$ ps -ef|grep gitlab
50 [liuyx@MiWiFi-R3L-srv ~]$ sudo kill -9 728    (注意这个进程号,和上面命令打印结果相结合)
52 [liuyx@MiWiFi-R3L-srv ~]$ ps -ef|grep gitlab
59 [root@MiWiFi-R3L-srv liuyx]# umount -rf /run/user/1000/gvfs
60 [root@MiWiFi-R3L-srv liuyx]# rm -rf /run/user/1000/gvfs
61 [root@MiWiFi-R3L-srv liuyx]# find / -name gitlab|xargs rm -rf

05-11 13:28