From 4f9de99695bd52db901c722920d42f130b2aa6e1 Mon Sep 17 00:00:00 2001 From: Matthias Fechner Date: Sat, 6 Feb 2021 15:34:28 +0000 Subject: [PATCH] Added a configuration variable gitlab_wait to configure how long to wait that gitlab is started. By default the value is 120 second. PR: 253289 Submitted by: vvd@unislabs.com --- www/gitlab-ce/Makefile | 2 +- www/gitlab-ce/files/gitlab.in | 16 +++++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/www/gitlab-ce/Makefile b/www/gitlab-ce/Makefile index d61995a5a199..2b04604a2700 100644 --- a/www/gitlab-ce/Makefile +++ b/www/gitlab-ce/Makefile @@ -3,7 +3,7 @@ PORTNAME?= gitlab-ce PORTVERSION?= 13.8.3 -PORTREVISION?= 0 +PORTREVISION?= 1 CATEGORIES= www devel MAINTAINER= mfechner@FreeBSD.org diff --git a/www/gitlab-ce/files/gitlab.in b/www/gitlab-ce/files/gitlab.in index 9158615e7903..7794339415a2 100644 --- a/www/gitlab-ce/files/gitlab.in +++ b/www/gitlab-ce/files/gitlab.in @@ -43,6 +43,7 @@ restart_cmd="restart_gitlab" : ${gitlab_workhorse_addr:="127.0.0.1:8181"} : ${gitlab_mail_room_enable:="NO"} : ${gitlab_allow_conflicts:="NO"} +: ${gitlab_wait:="120"} load_rc_config $name @@ -218,18 +219,19 @@ check_pids(){ ## Called when we have started the two processes and are waiting for their pid files. wait_for_pids(){ # We are sleeping a bit here mostly because sidekiq is slow at writing its pid - i=0; + i=0 while [ ! -f $web_server_pid_path ] || [ ! -f $sidekiq_pid_path ] || [ ! -f $gitlab_workhorse_pid_path ] || { [ "$mail_room_enabled" = true ] && [ ! -f $mail_room_pid_path ]; } || { [ "$gitlab_pages_enabled" = true ] && [ ! -f $gitlab_pages_pid_path ]; } || { [ "$gitaly_enabled" = true ] && [ ! -f $gitaly_pid_path ]; }; do - sleep 0.1; - i=$((i+1)) - if [ $((i%10)) = 0 ]; then - echo -n "." - elif [ $((i)) = 601 ]; then - echo "Waited 60s for the processes to write their pids, something probably went wrong." + echo -n "." + if [ $((i)) = "$gitlab_wait" ]; then + echo + echo "Waited ${i}s for the processes to write their pids, something probably went wrong." exit 1; fi + sleep 1 + i=$((i+1)) done echo + echo "Started in ${i}s." } # We use the pids in so many parts of the script it makes sense to always check them.