Commit 457b0f604fc005cc695627c558a39c9e14f3c6a0
1 parent
0c5e5569
Exists in
master
and in
4 other branches
use APP_ROOT in init-gitlab to specify root of project
Showing
1 changed file
with
8 additions
and
7 deletions
Show diff stats
lib/support/init-gitlab
... | ... | @@ -9,23 +9,24 @@ |
9 | 9 | # Description: GitLab git repository management |
10 | 10 | ### END INIT INFO |
11 | 11 | |
12 | -DAEMON_OPTS="-c /home/gitlab/gitlab/config/unicorn.rb -E production -D" | |
13 | -NAME=unicorn | |
12 | +APP_ROOT="/home/gitlab/gitlab" | |
13 | +DAEMON_OPTS="-c $APP_ROOT/config/unicorn.rb -E production -D" | |
14 | +NAME="unicorn" | |
14 | 15 | DESC="Gitlab service" |
15 | -PID=/home/gitlab/gitlab/tmp/pids/unicorn.pid | |
16 | -RESQUE_PID=/home/gitlab/gitlab/tmp/pids/resque_worker.pid | |
16 | +PID="$APP_ROOT/tmp/pids/unicorn.pid" | |
17 | +RESQUE_PID="$APP_ROOT/tmp/pids/resque_worker.pid" | |
17 | 18 | |
18 | 19 | case "$1" in |
19 | 20 | start) |
20 | - CD_TO_APP_DIR="cd /home/gitlab/gitlab" | |
21 | + CD_TO_APP_DIR="cd $APP_ROOT" | |
21 | 22 | START_DAEMON_PROCESS="bundle exec unicorn_rails $DAEMON_OPTS" |
22 | 23 | START_RESQUE_PROCESS="./resque.sh" |
23 | 24 | |
24 | 25 | echo -n "Starting $DESC: " |
25 | 26 | if [ `whoami` = root ]; then |
26 | - sudo -u gitlab sh -l -c "$CD_TO_APP_DIR > /dev/null 2>&1 && $START_DAEMON_PROCESS && $START_RESQUE_PROCESS" | |
27 | + sudo -u gitlab sh -l -c "$CD_TO_APP_DIR && $START_DAEMON_PROCESS && $START_RESQUE_PROCESS" | |
27 | 28 | else |
28 | - $CD_TO_APP_DIR > /dev/null 2>&1 && $START_DAEMON_PROCESS && $START_RESQUE_PROCESS | |
29 | + $CD_TO_APP_DIR && $START_DAEMON_PROCESS && $START_RESQUE_PROCESS | |
29 | 30 | fi |
30 | 31 | echo "$NAME." |
31 | 32 | ;; | ... | ... |