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