Commit 86874f00c36a543e12ea2b086908e73f92a50d5b

Authored by Dmitriy Zaporozhets
1 parent 02a7b127

init.d: Ensure socket is removed before starting service

Showing 1 changed file with 3 additions and 1 deletions   Show diff stats
lib/support/init.d/gitlab
... ... @@ -2,7 +2,7 @@
2 2  
3 3 # GITLAB
4 4 # Maintainer: @randx
5   -# App Version: 5.1
  5 +# App Version: 5.2
6 6  
7 7 ### BEGIN INIT INFO
8 8 # Provides: gitlab
... ... @@ -19,6 +19,7 @@ APP_ROOT="/home/git/gitlab"
19 19 APP_USER="git"
20 20 DAEMON_OPTS="-C $APP_ROOT/config/puma.rb"
21 21 PID_PATH="$APP_ROOT/tmp/pids"
  22 +SOCKET_PATH="$APP_ROOT/tmp/sockets"
22 23 WEB_SERVER_PID="$PID_PATH/puma.pid"
23 24 SIDEKIQ_PID="$PID_PATH/sidekiq.pid"
24 25 STOP_SIDEKIQ="RAILS_ENV=production bundle exec rake sidekiq:stop"
... ... @@ -50,6 +51,7 @@ start() {
50 51 exit 1
51 52 else
52 53 if [ `whoami` = root ]; then
  54 + execute "rm $SOCKET_PATH/gitlab.socket"
53 55 execute "RAILS_ENV=production bundle exec puma $DAEMON_OPTS"
54 56 execute "mkdir -p $PID_PATH && $START_SIDEKIQ > /dev/null 2>&1 &"
55 57 echo "$DESC started"
... ...