use APP_ROOT in init-gitlab to specify root of project
This commit is contained in:
parent
0c5e556922
commit
457b0f604f
1 changed files with 8 additions and 7 deletions
|
@ -9,23 +9,24 @@
|
||||||
# Description: GitLab git repository management
|
# Description: GitLab git repository management
|
||||||
### END INIT INFO
|
### END INIT INFO
|
||||||
|
|
||||||
DAEMON_OPTS="-c /home/gitlab/gitlab/config/unicorn.rb -E production -D"
|
APP_ROOT="/home/gitlab/gitlab"
|
||||||
NAME=unicorn
|
DAEMON_OPTS="-c $APP_ROOT/config/unicorn.rb -E production -D"
|
||||||
|
NAME="unicorn"
|
||||||
DESC="Gitlab service"
|
DESC="Gitlab service"
|
||||||
PID=/home/gitlab/gitlab/tmp/pids/unicorn.pid
|
PID="$APP_ROOT/tmp/pids/unicorn.pid"
|
||||||
RESQUE_PID=/home/gitlab/gitlab/tmp/pids/resque_worker.pid
|
RESQUE_PID="$APP_ROOT/tmp/pids/resque_worker.pid"
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
start)
|
start)
|
||||||
CD_TO_APP_DIR="cd /home/gitlab/gitlab"
|
CD_TO_APP_DIR="cd $APP_ROOT"
|
||||||
START_DAEMON_PROCESS="bundle exec unicorn_rails $DAEMON_OPTS"
|
START_DAEMON_PROCESS="bundle exec unicorn_rails $DAEMON_OPTS"
|
||||||
START_RESQUE_PROCESS="./resque.sh"
|
START_RESQUE_PROCESS="./resque.sh"
|
||||||
|
|
||||||
echo -n "Starting $DESC: "
|
echo -n "Starting $DESC: "
|
||||||
if [ `whoami` = root ]; then
|
if [ `whoami` = root ]; then
|
||||||
sudo -u gitlab sh -l -c "$CD_TO_APP_DIR > /dev/null 2>&1 && $START_DAEMON_PROCESS && $START_RESQUE_PROCESS"
|
sudo -u gitlab sh -l -c "$CD_TO_APP_DIR && $START_DAEMON_PROCESS && $START_RESQUE_PROCESS"
|
||||||
else
|
else
|
||||||
$CD_TO_APP_DIR > /dev/null 2>&1 && $START_DAEMON_PROCESS && $START_RESQUE_PROCESS
|
$CD_TO_APP_DIR && $START_DAEMON_PROCESS && $START_RESQUE_PROCESS
|
||||||
fi
|
fi
|
||||||
echo "$NAME."
|
echo "$NAME."
|
||||||
;;
|
;;
|
||||||
|
|
Loading…
Add table
Reference in a new issue