Skip to content

Commit f2fe5a9

Browse files
committed
Merge pull request #32 from thomwiggers/patch-1
Hardcoded gitlab_ci username
2 parents ed23bbc + 4b5b7f8 commit f2fe5a9

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

gitlab-ci/init.d/gitlab_ci

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
# Description: GitLab git repository management
1515
### END INIT INFO
1616

17-
18-
APP_ROOT="/home/gitlab_ci/gitlab-ci"
17+
USER="gitlab_ci"
18+
APP_ROOT="/home/$USER/gitlab-ci"
1919
DAEMON_OPTS="-p 3000 -d -e production"
2020
PID_PATH="$APP_ROOT/tmp/pids"
2121
THIN_PID="$PID_PATH/thin.pid"
@@ -42,8 +42,8 @@ start() {
4242
exit 1
4343
else
4444
if [ `whoami` = root ]; then
45-
sudo -u gitlab_ci -H sh -l -c "nohup bundle exec thin start $DAEMON_OPTS > /dev/null 2>&1 &"
46-
sudo -u gitlab_ci -H sh -l -c "mkdir -p $PID_PATH && nohup bundle exec rake environment resque:work QUEUE=runner RAILS_ENV=production PIDFILE=$RESQUE_PID > /dev/null 2>&1 &"
45+
sudo -u $USER -H sh -l -c "nohup bundle exec thin start $DAEMON_OPTS > /dev/null 2>&1 &"
46+
sudo -u $USER -H sh -l -c "mkdir -p $PID_PATH && nohup bundle exec rake environment resque:work QUEUE=runner RAILS_ENV=production PIDFILE=$RESQUE_PID > /dev/null 2>&1 &"
4747
echo "$DESC started"
4848
fi
4949
fi

0 commit comments

Comments
 (0)