sudo gitlab-ctl status
输出示例(正常运行):

run: gitaly: (pid 1234) 1234s; run: log: (pid 1230) 1235srun: gitlab-workhorse: (pid 1236) 1234s; run: log: (pid 1231) 1235srun: nginx: (pid 1237) 1234s; run: log: (pid 1232) 1235srun: postgresql: (pid 1238) 1234s; run: log: (pid 1233) 1235srun: redis: (pid 1239) 1234s; run: log: (pid 1234) 1235srun: sidekiq: (pid 1240) 1234s; run: log: (pid 1235) 1235srun: unicorn: (pid 1241) 1234s; run: log: (pid 1236) 1235s
run: = 正常运行down: = 已停止只看汇总简化输出:
sudo gitlab-ctl status | grep down
无输出代表全部组件正常。
GitLab 整套托管在 gitlab-runsvdir:
systemctl status gitlab-runsvdir
active (running):GitLab 总服务已启动inactive (dead):完全关闭默认 GitLab 使用 80/443 端口:
# 查看80、443端口监听ss -tlnp | grep -E "80|443"
看到 nginx 进程即 Web 服务正常。
# 启动sudo gitlab-ctl start# 停止sudo gitlab-ctl stop# 重启sudo gitlab-ctl restart# 重载配置(改gitlab.rb后执行)sudo gitlab-ctl reconfigure
如果是手动源码编译,用:
# 检查 unicorn/puma、redis、postgresql、nginx 进程ps aux | grep -E "unicorn|puma|redis|postgres"
# 存在配置文件即代表已安装ls /etc/gitlab/gitlab.rb
文件不存在 = 未安装 GitLab。