diff --git a/init/sysvinit/centos/gitlab-only-sidekiq b/init/sysvinit/centos/gitlab-only-sidekiq index d5df2c9..d788dca 100755 --- a/init/sysvinit/centos/gitlab-only-sidekiq +++ b/init/sysvinit/centos/gitlab-only-sidekiq @@ -2,7 +2,7 @@ # # GitLab # Contributors : @elvanja, @troyanov, @eiyaya, @foyo23, @nielsbasjes, @relip, @JasonMing, @andronat, @axilleas -# App Version : 6.x +# App Version : 6.x - 7.x # chkconfig: 2345 82 55 # processname: sidekiq @@ -37,7 +37,7 @@ start() { # Start sidekiq echo -n $"Starting sidekiq: " - daemon --pidfile=$SPID --user=$USER "$PATH_PATCH RAILS_ENV=$RAILS_ENV script/background_jobs start" + daemon --pidfile=$SPID --user=$USER "$PATH_PATCH RAILS_ENV=$RAILS_ENV bin/background_jobs start" sidekiq=$? [ $sidekiq -eq 0 ] && touch $SLOCK echo diff --git a/init/sysvinit/centos/gitlab-puma b/init/sysvinit/centos/gitlab-puma old mode 100644 new mode 100755 index 02af468..4b9ea20 --- a/init/sysvinit/centos/gitlab-puma +++ b/init/sysvinit/centos/gitlab-puma @@ -2,7 +2,7 @@ # # GitLab # Contributors : @elvanja, @troyanov, @eiyaya, @foyo23, @nielsbasjes, @relip, @JasonMing, @andronat -# App Version : 6.x +# App Version : 6.x -7.x # chkconfig: 2345 82 55 # processname: puma @@ -24,6 +24,9 @@ ORIGINAL_PATH=$PATH # Restore original $PATH PATH=$ORIGINAL_PATH +### Environment variables +RAILS_ENV="production" + # The name of the service NAME=git @@ -32,8 +35,8 @@ USER=git APP_PATH=/home/$USER/gitlab # The PID and LOCK files used by puma and sidekiq -UPID=$APP_PATH/tmp/pids/puma.pid -ULOCK=/var/lock/subsys/puma +PPID=$APP_PATH/tmp/pids/puma.pid +PLOCK=/var/lock/subsys/puma SPID=$APP_PATH/tmp/pids/sidekiq.pid SLOCK=/var/lock/subsys/sidekiq @@ -51,12 +54,12 @@ start() { echo -n $"Starting puma: " daemon --pidfile=$UPID --user=$USER "$RUBY_PATH_PATCH bundle exec puma $OPTS" puma=$? - [ $puma -eq 0 ] && touch $ULOCK + [ $puma -eq 0 ] && touch $PLOCK echo # Start sidekiq echo -n $"Starting sidekiq: " - daemon --pidfile=$SPID --user=$USER "$RUBY_PATH_PATCH RAILS_ENV=production bundle exec rake sidekiq:start" + daemon --pidfile=$SPID --user=$USER "$RUBY_PATH_PATCH RAILS_ENV=$RAILS_ENV bin/background_jobs start" sidekiq=$? [ $sidekiq -eq 0 ] && touch $SLOCK echo @@ -72,7 +75,7 @@ stop() { echo -n $"Stopping puma: " killproc -p $UPID puma=$? - [ $puma -eq 0 ] && rm -f $ULOCK + [ $puma -eq 0 ] && rm -f $PLOCK echo # Stop sidekiq @@ -92,7 +95,7 @@ restart() { } get_status() { - status -p $UPID puma + status -p $PPID puma status -p $SPID sidekiq } diff --git a/init/sysvinit/centos/gitlab-unicorn b/init/sysvinit/centos/gitlab-unicorn index 4fa9d90..313a61c 100755 --- a/init/sysvinit/centos/gitlab-unicorn +++ b/init/sysvinit/centos/gitlab-unicorn @@ -2,7 +2,7 @@ # # GitLab # Contributors : @elvanja, @troyanov, @eiyaya, @foyo23, @nielsbasjes, @relip, @JasonMing, @andronat, @axilleas, @mdirkse -# App Version : 6.x +# App Version : 6.x - 7.x # chkconfig: 2345 82 55 # processname: unicorn @@ -40,14 +40,14 @@ start() { # Start unicorn echo -n $"Starting unicorn: " - daemon --pidfile=$UPID --user=$USER "$PATH_PATCH RAILS_ENV=$RAILS_ENV script/web start" + daemon --pidfile=$UPID --user=$USER "$PATH_PATCH RAILS_ENV=$RAILS_ENV bin/web start" unicorn=$? [ $unicorn -eq 0 ] && touch $ULOCK echo # Start sidekiq echo -n $"Starting sidekiq: " - daemon --pidfile=$SPID --user=$USER "$PATH_PATCH RAILS_ENV=$RAILS_ENV script/background_jobs start" + daemon --pidfile=$SPID --user=$USER "$PATH_PATCH RAILS_ENV=$RAILS_ENV bin/background_jobs start" sidekiq=$? [ $sidekiq -eq 0 ] && touch $SLOCK echo @@ -121,4 +121,4 @@ case "$1" in ;; esac -exit 0 \ No newline at end of file +exit 0