From 3a4bc94329590b7c0dafaac8a82cce319bebb5ff Mon Sep 17 00:00:00 2001 From: stephen zhen Date: Thu, 24 Jan 2013 08:49:35 +0800 Subject: [PATCH] change resque to sidekiq, for gitlab 4.1 --- init.d/gitlab-centos | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/init.d/gitlab-centos b/init.d/gitlab-centos index 739dc6c..b0f55a2 100644 --- a/init.d/gitlab-centos +++ b/init.d/gitlab-centos @@ -1,13 +1,13 @@ #!/bin/bash # # GitLab -# Maintainer: @elvanja, @troyanov -# App Version: 4.0 +# Maintainer: @elvanja, @troyanov, @eiyaya +# App Version: 4.1 # chkconfig: 2345 82 55 # processname: unicorn # processname: rescue -# description: Runs unicorn and resque for nginx integration. +# description: Runs unicorn and sidekiq for nginx integration. # Related (kudos @4sak3n0ne): # https://github.com/gitlabhq/gitlabhq/issues/1049#issuecomment-8386882 @@ -23,17 +23,17 @@ NAME=gitlab USER=$NAME APP_PATH=/home/$USER/gitlab -# The PID and LOCK files used by unicorn and resque +# The PID and LOCK files used by unicorn and sidekiq UPID=$APP_PATH/tmp/pids/unicorn.pid ULOCK=/var/lock/subsys/unicorn -RPID=$APP_PATH/tmp/pids/resque_worker.pid -RLOCK=/var/lock/subsys/resque +RPID=$APP_PATH/tmp/pids/sidekiq.pid +RLOCK=/var/lock/subsys/sidekiq # The options to use when running unicorn OPTS="-c $APP_PATH/config/unicorn.rb -E production -D" # Ruby related path update -RUBY_PATH_PATCH="PATH=$PATH:/usr/local/bin:/usr/local/lib && export PATH && " +RUBY_PATH_PATCH="PATH=$PATH:/usr/local/bin:/usr/local/lib:/home/gitlab/bin && export PATH && " start() { cd $APP_PATH @@ -45,14 +45,14 @@ start() { [ $unicorn -eq 0 ] && touch $ULOCK echo - # Start resque - echo -n $"Starting resque: " - daemon --pidfile=$RPID --user=$USER "$RUBY_PATH_PATCH ./resque.sh" - resque=$? - [ $resque -eq 0 ] && touch $RLOCK + # Start sidekiq + echo -n $"Starting sidekiq: " + daemon --pidfile=$RPID --user=$USER "$RUBY_PATH_PATCH RAILS_ENV=production bundle exec rake sidekiq:start" + sidekiq=$? + [ $sidekiq -eq 0 ] && touch $RLOCK echo - retval=$unicorn || $resque + retval=$unicorn || $sidekiq return $retval } @@ -66,14 +66,14 @@ stop() { [ $unicorn -eq 0 ] && rm -f $ULOCK echo - # Stop resque - echo -n $"Stopping resque: " + # Stop sidekiq + echo -n $"Stopping sidekiq: " killproc -p $RPID - resque=$? - [ $resque -eq 0 ] && rm -f $RLOCK + sidekiq=$? + [ $sidekiq -eq 0 ] && rm -f $RLOCK echo - retval=$unicorn || $resque + retval=$unicorn || $sidekiq return $retval } @@ -84,7 +84,7 @@ restart() { get_status() { status -p $UPID unicorn - status -p $RPID resque + status -p $RPID sidekiq } query_status() { @@ -113,4 +113,4 @@ case "$1" in ;; esac -exit 0 +exit 0 \ No newline at end of file