使用 sudo gitlab-ctl start 命令启动 gitlab,示例如下:
hxstrive@localhost:~$ sudo gitlab-ctl start ok: run: alertmanager: (pid 65953) 0s ok: run: gitaly: (pid 65965) 0s ok: run: gitlab-exporter: (pid 65989) 1s ok: run: gitlab-workhorse: (pid 65991) 0s ok: run: grafana: (pid 66000) 1s ok: run: logrotate: (pid 66013) 0s ok: run: nginx: (pid 66021) 1s ok: run: node-exporter: (pid 66029) 0s ok: run: postgres-exporter: (pid 66036) 0s ok: run: postgresql: (pid 66043) 1s ok: run: prometheus: (pid 66052) 0s ok: run: puma: (pid 66061) 1s ok: run: redis: (pid 66068) 0s ok: run: redis-exporter: (pid 66074) 0s ok: run: sidekiq: (pid 66081) 0s
使用 sudo gitlab-ctl stop 命令关闭 gitlab,示例如下:
hxstrive@localhost:~$ sudo gitlab-ctl stop ok: down: alertmanager: 0s, normally up ok: down: gitaly: 0s, normally up ok: down: gitlab-exporter: 1s, normally up ok: down: gitlab-workhorse: 0s, normally up ok: down: grafana: 0s, normally up ok: down: logrotate: 1s, normally up ok: down: nginx: 0s, normally up ok: down: node-exporter: 1s, normally up ok: down: postgres-exporter: 0s, normally up ok: down: postgresql: 1s, normally up ok: down: prometheus: 0s, normally up ok: down: puma: 1s, normally up ok: down: redis: 0s, normally up ok: down: redis-exporter: 1s, normally up ok: down: sidekiq: 0s, normally up
使用 sudo gitlab-ctl status 命令查看 gitlab 状态,示例如下:
hxstrive@localhost:~$ sudo gitlab-ctl status run: alertmanager: (pid 12489) 137517s; run: log: (pid 12473) 137517s run: gitaly: (pid 12498) 137517s; run: log: (pid 12488) 137517s run: gitlab-exporter: (pid 12504) 137517s; run: log: (pid 12495) 137517s run: gitlab-workhorse: (pid 12492) 137517s; run: log: (pid 12476) 137517s run: grafana: (pid 12482) 137517s; run: log: (pid 12469) 137517s run: logrotate: (pid 56034) 133917s; run: log: (pid 12458) 137517s run: nginx: (pid 12481) 137517s; run: log: (pid 12468) 137517s run: node-exporter: (pid 12502) 137517s; run: log: (pid 12474) 137517s run: postgres-exporter: (pid 12467) 137518s; run: log: (pid 12459) 137518s run: postgresql: (pid 12503) 137518s; run: log: (pid 12487) 137518s run: prometheus: (pid 12483) 137518s; run: log: (pid 12466) 137518s run: puma: (pid 12490) 137518s; run: log: (pid 12475) 137518s run: redis: (pid 12494) 137518s; run: log: (pid 12477) 137518s run: redis-exporter: (pid 12499) 137518s; run: log: (pid 12484) 137518s run: sidekiq: (pid 12486) 137518s; run: log: (pid 12472) 137518s
使用 sudo systemctl disable gitlab-runsvdir.service 命令启用 gitlab 开机启动,示例如下:
hxstrive@localhost:~$ sudo systemctl disable gitlab-runsvdir.service Removed /etc/systemd/system/multi-user.target.wants/gitlab-runsvdir.service.
使用 sudo systemctl enable gitlab-runsvdir.service 命令禁用 gitlab 开机启动,示例如下:
hxstrive@localhost:~$ sudo systemctl enable gitlab-runsvdir.service Created symlink /etc/systemd/system/multi-user.target.wants/gitlab-runsvdir.service → /lib/systemd/system/gitlab-runsvdir.service.