Check Gitlab Status via Command Line

Posted on

To be able to check the status of Gitlab, off course the important thing is to have gitlab itself installed. The installation process can be read in the following article after titled ‘Install Gitlab on CentOS 7 via Command Line’ in this link. Another important reference which can be used in an article titled ‘Install Gitlab on Ubuntu via Command Line in the following link.

After installing Gitlab, to be able to run it perfectly, just read the following article which is explaining on how to run Gitlab’s service in the following article titled ‘Start Gitlab via Command Line’. The article can be visited in the following link.

So, the command to view the current status of Gitlab’s service is shown below :

gitlab-ctl status

The output of the above executed command is actually viewed as follows :

[root@centos ~]# gitlab-ctl 
status run: gitlab-workhorse: (pid 16411) 20257s; 
run: log: (pid 1596) 41531s 
run: logrotate: (pid 10329) 3295s; 
run: log: (pid 1628) 41528s 
run: nginx: (pid 16425) 20256s; 
run: log: (pid 1619) 41530s 
run: postgresql: (pid 16433) 20256s; 
run: log: (pid 1334) 41576s 
run: redis: (pid 16441) 20255s; 
run: log: (pid 1226) 41582s 
run: sidekiq: (pid 16445) 20255s; 
run: log: (pid 1555) 41537s 
run: unicorn: (pid 16452) 20254s; 
run: log: (pid 1488) 41539s 
[root@centos ~]#

The image viewing the output of the above executed comand is shown below :

Check Gitlab Status via Command Line
Check Gitlab Status via Command Line

This is the image which is used to display the main page of Gitlab in Mozilla Firefox browser if Gitlab based on the status is stated as running properly :

Check Gitlab Status via Command Line
Check Gitlab Status via Command Line

Another way to check whether Gitlab’s service is running or not is by using the internal command which is provided by the operating system itself. As we already know, every service running in an operating system is registered after the installation process is done. The most important thing is to find out what is the name of the service responsible for running Gitlab. Below is how to do it properly in Ubuntu Linux operating system distribution :

root@hostname:~# systemctl --all | grep gitlab
  gitlab-runsvdir.service                                                                                                          loaded    active   running   GitLab Runit supervision process
root@hostname:~# 

So, based on the output of the above command, we knew that the process associated with gitlab is named as ‘gitlab-runsvdir.service’. Just type the following command to find out the status of the service :

systemctl status gitlab-runsvdir.service

Below is the output of the command’s execution :

root@hostname:~# systemctl status gitlab-runsvdir.service
● gitlab-runsvdir.service - GitLab Runit supervision process
Loaded: loaded (/usr/lib/systemd/system/gitlab-runsvdir.service; enabled; vendor preset: enabled)
Active: active (running) since Tue 2017-01-10 09:33:31; 1h 29min ago
Main PID: 1048 (runsvdir)
Tasks: 94
Memory: 782.3M
CPU: 2min 27.913s
CGroup: /system.slice/gitlab-runsvdir.service
├─ 1048 runsvdir -P /opt/gitlab/service log: ..........................................................................................................................................................................
├─ 1108 runsv postgresql
├─ 1109 runsv unicorn
├─ 1110 runsv redis
├─ 1111 runsv sidekiq
├─ 1112 runsv logrotate
├─ 1113 runsv gitlab-workhorse
├─ 1114 runsv nginx
├─ 1140 svlogd -tt /var/log/gitlab/logrotate
├─ 1141 svlogd -tt /var/log/gitlab/nginx
├─ 1142 svlogd -tt /var/log/gitlab/gitlab-workhorse
├─ 1148 svlogd -tt /var/log/gitlab/redis
├─ 1150 svlogd -tt /var/log/gitlab/unicorn
├─ 1151 svlogd -tt /var/log/gitlab/postgresql
├─ 1153 /opt/gitlab/embedded/bin/gitlab-workhorse -listenNetwork unix -listenUmask 0 -listenAddr /var/opt/gitlab/gitlab-workhorse/socket -authBackend http://localhost:8080 -authSocket /var/opt/gitlab/gitlab-rails/so
├─ 1155 nginx: master process /opt/gitlab/embedded/sbin/nginx -p /var/opt/gitlab/ngin
├─ 1156 /opt/gitlab/embedded/bin/redis-server 127.0.0.1:0
├─ 1159 /bin/bash /opt/gitlab/embedded/bin/gitlab-unicorn-wrapper
├─ 1161 /opt/gitlab/embedded/bin/postgres -D /var/opt/gitlab/postgresql/data
├─ 1172 svlogd -tt /var/log/gitlab/sidekiq
├─ 1174 sidekiq 4.2.7 gitlab-rails [0 of 25 busy]
├─ 1245 nginx: worker process
├─ 1246 nginx: worker process
├─ 1247 nginx: worker process
├─ 1248 nginx: worker process
├─ 1249 nginx: cache manager process
├─ 2873 unicorn master -D -E production -c /var/opt/gitlab/gitlab-rails/etc/unicorn.rb /opt/gitlab/embedded/service/gitlab-rails/config.ru
├─ 2940 postgres: checkpointer process
├─ 2941 postgres: writer process
├─ 2942 postgres: wal writer process
├─ 2943 postgres: autovacuum launcher process
├─ 2944 postgres: stats collector process
├─ 3031 postgres: gitlab gitlabhq_production [local] idle
├─ 3033 postgres: gitlab gitlabhq_production [local] idle
├─ 3059 unicorn worker[0] -D -E production -c /var/opt/gitlab/gitlab-rails/etc/unicorn.rb /opt/gitlab/embedded/service/gitlab-rails/config.ru
├─ 3062 unicorn worker[1] -D -E production -c /var/opt/gitlab/gitlab-rails/etc/unicorn.rb /opt/gitlab/embedded/service/gitlab-rails/config.ru
├─ 3065 unicorn worker[2] -D -E production -c /var/opt/gitlab/gitlab-rails/etc/unicorn.rb /opt/gitlab/embedded/service/gitlab-rails/config.ru
├─ 3068 unicorn worker[3] -D -E production -c /var/opt/gitlab/gitlab-rails/etc/unicorn.rb /opt/gitlab/embedded/service/gitlab-rails/config.ru
├─ 3071 unicorn worker[4] -D -E production -c /var/opt/gitlab/gitlab-rails/etc/unicorn.rb /opt/gitlab/embedded/service/gitlab-rails/config.ru
├─ 3302 postgres: gitlab gitlabhq_production [local] idle
├─ 6674 postgres: gitlab gitlabhq_production [local] idle
├─ 7344 postgres: gitlab gitlabhq_production [local] idle
├─ 7749 postgres: gitlab gitlabhq_production [local] idle
├─ 8086 postgres: gitlab gitlabhq_production [local] idle
├─ 9038 postgres: gitlab gitlabhq_production [local] idle
├─12830 /bin/sh /opt/gitlab/embedded/bin/gitlab-logrotate-wrapper
├─13872 sleep 3000
lines 1-55

Leave a Reply