【Git】如何检查 Ubuntu 系统上 gitLab 是否开启

Ubuntu 检查 GitLab 是否运行(Omnibus 官方安装包,主流方式)

1. 查看 gitlab 服务状态(最推荐)

bash 复制代码
sudo gitlab-ctl status

输出示例(正常运行):

复制代码
run: gitaly: (pid 1234) 1234s; run: log: (pid 1230) 1235s
run: gitlab-workhorse: (pid 1236) 1234s; run: log: (pid 1231) 1235s
run: nginx: (pid 1237) 1234s; run: log: (pid 1232) 1235s
run: postgresql: (pid 1238) 1234s; run: log: (pid 1233) 1235s
run: redis: (pid 1239) 1234s; run: log: (pid 1234) 1235s
run: sidekiq: (pid 1240) 1234s; run: log: (pid 1235) 1235s
run: unicorn: (pid 1241) 1234s; run: log: (pid 1236) 1235s
  • run: = 正常运行
  • down: = 已停止

只看汇总简化输出:

bash 复制代码
sudo gitlab-ctl status | grep down

无输出代表全部组件正常。

2. 查看系统 systemd 服务

GitLab 整套托管在 gitlab-runsvdir

bash 复制代码
systemctl status gitlab-runsvdir
  • active (running):GitLab 总服务已启动
  • inactive (dead):完全关闭

3. 端口监听检测(验证 Web 服务可访问)

默认 GitLab 使用 80/443 端口:

bash 复制代码
# 查看80、443端口监听
ss -tlnp | grep -E "80|443"

看到 nginx 进程即 Web 服务正常。

4. 快速启停命令备用

bash 复制代码
# 启动
sudo gitlab-ctl start
# 停止
sudo gitlab-ctl stop
# 重启
sudo gitlab-ctl restart
# 重载配置(改gitlab.rb后执行)
sudo gitlab-ctl reconfigure

5. 源码部署 GitLab(非 omnibus 安装,极少用)

如果是手动源码编译,用:

bash 复制代码
# 检查 unicorn/puma、redis、postgresql、nginx 进程
ps aux | grep -E "unicorn|puma|redis|postgres"

补充:判断机器是否安装过 GitLab

bash 复制代码
# 存在配置文件即代表已安装
ls /etc/gitlab/gitlab.rb

文件不存在 = 未安装 GitLab。

相关推荐
IT摆渡者17 小时前
ubuntu系统网络问题
linux·运维·ubuntu
.Hypocritical.18 小时前
Git 全套实操|配置 /.gitignore/ 分支合并 / 冲突解决 /git stash 完整教程
git
来日方长。。。。long18 小时前
Hermes Agent橙皮书共读|第三篇:保姆级实战部署|本地/VPS从零搭建Hermes
ide·git·hermes
其实防守也摸鱼19 小时前
VS Code Git 工作树:解锁多分支并行开发新体验
数据库·git·安全·oracle·架构·自动化
ERD Online20 小时前
我们怎么设计 good first issue:让第一个 PR 两小时内合入
数据库·git·后端·开源·issue
海兰20 小时前
ffmpeg-wasm 完整安装指南(Ubuntu 24.04)
ubuntu·ffmpeg·wasm
海兰20 小时前
云原生持续交付平台 Zadig 在 Ubuntu 24.04 上的部署及使用指南
linux·ubuntu·云原生
Anesthesia丶1 天前
PromoxVE安装笔记
笔记·ubuntu·server·promox
Python私教1 天前
Codex 自动写 Commit 够安全吗?一套证据化 Git 提交流程
人工智能·git·后端
果果燕1 天前
实习笔记(一):NFS、Samba、VNC、Git、CMake、systemd、内核、交叉编译
linux·arm开发·c++·笔记·git