summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-05-28 17:08:21 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-06-07 09:24:42 +0300
commit86874f00c36a543e12ea2b086908e73f92a50d5b (patch)
treed41d1f2afa349172d02af0baa29106b0f3f004d6
parent02a7b1270bbe35a14b3c7701bcbcff39abc646da (diff)
downloadgitlab-ce-86874f00c36a543e12ea2b086908e73f92a50d5b.tar.gz
init.d: Ensure socket is removed before starting service
-rw-r--r--lib/support/init.d/gitlab4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/support/init.d/gitlab b/lib/support/init.d/gitlab
index 4c5499bbf23..f4ca07b3676 100644
--- a/lib/support/init.d/gitlab
+++ b/lib/support/init.d/gitlab
@@ -2,7 +2,7 @@
# GITLAB
# Maintainer: @randx
-# App Version: 5.1
+# App Version: 5.2
### BEGIN INIT INFO
# Provides: gitlab
@@ -19,6 +19,7 @@ APP_ROOT="/home/git/gitlab"
APP_USER="git"
DAEMON_OPTS="-C $APP_ROOT/config/puma.rb"
PID_PATH="$APP_ROOT/tmp/pids"
+SOCKET_PATH="$APP_ROOT/tmp/sockets"
WEB_SERVER_PID="$PID_PATH/puma.pid"
SIDEKIQ_PID="$PID_PATH/sidekiq.pid"
STOP_SIDEKIQ="RAILS_ENV=production bundle exec rake sidekiq:stop"
@@ -50,6 +51,7 @@ start() {
exit 1
else
if [ `whoami` = root ]; then
+ execute "rm $SOCKET_PATH/gitlab.socket"
execute "RAILS_ENV=production bundle exec puma $DAEMON_OPTS"
execute "mkdir -p $PID_PATH && $START_SIDEKIQ > /dev/null 2>&1 &"
echo "$DESC started"