summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorOishi <chehaojia@gmail.com>2013-08-06 11:14:20 +0800
committerOishi <chehaojia@gmail.com>2013-08-06 11:14:20 +0800
commit228f91c7a6942068efb496701a7d6c91980623ed (patch)
tree77cfc0ab81217e0ba55c45d4455285438a3c2dd0 /lib
parent7626602f75b3ace16eb963672b12d2047f92a628 (diff)
downloadgitlab-ci-228f91c7a6942068efb496701a7d6c91980623ed.tar.gz
fix issuess #160
Diffstat (limited to 'lib')
-rw-r--r--lib/support/init.d/gitlab_ci3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/support/init.d/gitlab_ci b/lib/support/init.d/gitlab_ci
index 21bc412..cb05054 100644
--- a/lib/support/init.d/gitlab_ci
+++ b/lib/support/init.d/gitlab_ci
@@ -17,6 +17,8 @@
APP_USER="gitlab_ci"
APP_ROOT="/home/$APP_USER/gitlab-ci"
DAEMON_OPTS="-C $APP_ROOT/config/puma.rb -e production"
+SOCKET_PATH="$APP_ROOT/tmp/sockets"
+SOCKET_FILE="$SOCKET_PATH/gitlab-ci.socket"
PID_PATH="$APP_ROOT/tmp/pids"
WEB_SERVER_PID="$PID_PATH/puma.pid"
SIDEKIQ_PID="$PID_PATH/sidekiq.pid"
@@ -45,6 +47,7 @@ start() {
exit 1
else
if [ `whoami` = root ]; then
+ ! [ -e $SOCKET_FILE ] || sudo -u $APP_USER -H bash -l -c "rm $SOCKET_FILE"
sudo -u $APP_USER -H bash -l -c "RAILS_ENV=production bundle exec puma $DAEMON_OPTS"
sudo -u $APP_USER -H bash -l -c "mkdir -p $PID_PATH && $START_SIDEKIQ > /dev/null 2>&1 &"
echo "$DESC started"