From 66f28577adc8fef997913cd05ae5884777010cb5 Mon Sep 17 00:00:00 2001 From: Jacob Vosmaer Date: Thu, 14 Jan 2016 15:08:15 +0100 Subject: Improve bin/ launchers --- bin/background_jobs | 7 +++++-- bin/web | 11 ++++++++++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/bin/background_jobs b/bin/background_jobs index 5c85fb339e6..5740539cb85 100755 --- a/bin/background_jobs +++ b/bin/background_jobs @@ -32,12 +32,12 @@ restart() start_no_deamonize() { - start_sidekiq + start_sidekiq >> $sidekiq_logfile 2>&1 } start_sidekiq() { - bundle exec sidekiq -q post_receive -q mailers -q archive_repo -q system_hook -q project_web_hook -q gitlab_shell -q incoming_email -q runner -q common -q default -e $RAILS_ENV -P $sidekiq_pidfile $@ >> $sidekiq_logfile 2>&1 + bundle exec sidekiq -q post_receive -q mailers -q archive_repo -q system_hook -q project_web_hook -q gitlab_shell -q incoming_email -q runner -q common -q default -e $RAILS_ENV -P $sidekiq_pidfile "$@" } load_ok() @@ -66,6 +66,9 @@ case "$1" in start_no_deamonize) start_no_deamonize ;; + start_foreground) + start_sidekiq + ;; restart) restart ;; diff --git a/bin/web b/bin/web index 67f236eb0bb..03fe7a6354b 100755 --- a/bin/web +++ b/bin/web @@ -5,6 +5,7 @@ app_root=$(pwd) unicorn_pidfile="$app_root/tmp/pids/unicorn.pid" unicorn_config="$app_root/config/unicorn.rb" +unicorn_cmd="bundle exec unicorn_rails -c $unicorn_config -E $RAILS_ENV" get_unicorn_pid() { @@ -18,7 +19,12 @@ get_unicorn_pid() start() { - bundle exec unicorn_rails -D -c $unicorn_config -E $RAILS_ENV + $unicorn_cmd -D +} + +start_foreground() +{ + $unicorn_cmd } stop() @@ -37,6 +43,9 @@ case "$1" in start) start ;; + start_foreground) + start_foreground + ;; stop) stop ;; -- cgit v1.2.1 From 3fa8d5d09aca5d286d1139d01832f16becae9930 Mon Sep 17 00:00:00 2001 From: Jacob Vosmaer Date: Thu, 14 Jan 2016 15:08:22 +0100 Subject: Remove duplication in Procfile --- Procfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Procfile b/Procfile index 9cfdee7040f..cad738d4292 100644 --- a/Procfile +++ b/Procfile @@ -2,6 +2,6 @@ # https://gitlab.com/gitlab-org/omnibus-gitlab or the init scripts in # lib/support/init.d, which call scripts in bin/ . # -web: bundle exec unicorn_rails -p ${PORT:="3000"} -E ${RAILS_ENV:="development"} -c ${UNICORN_CONFIG:="config/unicorn.rb"} -worker: bundle exec sidekiq -q post_receive -q mailers -q archive_repo -q system_hook -q project_web_hook -q gitlab_shell -q incoming_email -q runner -q common -q default +web: RAILS_ENV=development bin/web start_foreground +worker: RAILS_ENV=development bin/background_jobs start_foreground # mail_room: bundle exec mail_room -q -c config/mail_room.yml -- cgit v1.2.1 From d28332cc9e1dcf0f56000fbf21ab82436d28e990 Mon Sep 17 00:00:00 2001 From: Jacob Vosmaer Date: Fri, 15 Jan 2016 11:12:49 +0100 Subject: Direct sidekiq boot output to log file This behavior got lost in the previous commit. --- bin/background_jobs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/background_jobs b/bin/background_jobs index 5740539cb85..1f67d732949 100755 --- a/bin/background_jobs +++ b/bin/background_jobs @@ -27,7 +27,7 @@ restart() stop fi killall - start_sidekiq -d -L $sidekiq_logfile + start_sidekiq -d -L $sidekiq_logfile >> $sidekiq_logfile 2>&1 } start_no_deamonize() -- cgit v1.2.1