Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTse-Ching Ho <tsechingho@gmail.com>2012-09-03 17:04:10 +0400
committerTse-Ching Ho <tsechingho@gmail.com>2012-09-04 12:39:10 +0400
commit457b0f604fc005cc695627c558a39c9e14f3c6a0 (patch)
tree6df6205d00bf21d34a35a68c1650c46fb8215435 /lib
parent0c5e556922b4c7ff71c6af6255a0f6783e25ca0c (diff)
use APP_ROOT in init-gitlab to specify root of project
Diffstat (limited to 'lib')
-rw-r--r--lib/support/init-gitlab15
1 files changed, 8 insertions, 7 deletions
diff --git a/lib/support/init-gitlab b/lib/support/init-gitlab
index f146e80f4a8..26ed11e184d 100644
--- a/lib/support/init-gitlab
+++ b/lib/support/init-gitlab
@@ -9,23 +9,24 @@
# Description: GitLab git repository management
### END INIT INFO
-DAEMON_OPTS="-c /home/gitlab/gitlab/config/unicorn.rb -E production -D"
-NAME=unicorn
+APP_ROOT="/home/gitlab/gitlab"
+DAEMON_OPTS="-c $APP_ROOT/config/unicorn.rb -E production -D"
+NAME="unicorn"
DESC="Gitlab service"
-PID=/home/gitlab/gitlab/tmp/pids/unicorn.pid
-RESQUE_PID=/home/gitlab/gitlab/tmp/pids/resque_worker.pid
+PID="$APP_ROOT/tmp/pids/unicorn.pid"
+RESQUE_PID="$APP_ROOT/tmp/pids/resque_worker.pid"
case "$1" in
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_RESQUE_PROCESS="./resque.sh"
echo -n "Starting $DESC: "
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
- $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
echo "$NAME."
;;