summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJacob Vosmaer <contact@jacobvosmaer.nl>2013-12-10 04:09:50 -0800
committerJacob Vosmaer <contact@jacobvosmaer.nl>2013-12-10 04:09:50 -0800
commit427e68ecbebcb87bc35d0818913946aabd475912 (patch)
tree5e4831f027fed20c73626188df4ff9f011537048 /lib
parent16697f6efa4653986753905ab9100fa11dde7f09 (diff)
parentfc088f0c715cfebfad98532c23975221eff5c2d1 (diff)
downloadgitlab-ce-427e68ecbebcb87bc35d0818913946aabd475912.tar.gz
Merge pull request #5801 from Rovanion/default-doc
Added example defaults file and appropriate documentation.
Diffstat (limited to 'lib')
-rwxr-xr-xlib/support/init.d/gitlab20
-rwxr-xr-xlib/support/init.d/gitlab.default.example14
2 files changed, 27 insertions, 7 deletions
diff --git a/lib/support/init.d/gitlab b/lib/support/init.d/gitlab
index 9cf3aa5fe85..f1b94087b6a 100755
--- a/lib/support/init.d/gitlab
+++ b/lib/support/init.d/gitlab
@@ -15,11 +15,20 @@
# Description: GitLab git repository management
### END INIT INFO
+
+###
+# DO NOT EDIT THIS FILE!
+# This file will be overwritten on update.
+# Instead add/change your variables in /etc/default/gitlab
+# An example defaults file can be found in lib/support/default/gitlab
+###
+
+
### Environment variables
RAILS_ENV="production"
-# Script variable names should be lower-case not to conflict with internal
-# /bin/sh variables such as PATH, EDITOR or SHELL.
+# Script variable names should be lower-case not to conflict with
+# internal /bin/sh variables such as PATH, EDITOR or SHELL.
app_user="git"
app_root="/home/$app_user/gitlab"
pid_path="$app_root/tmp/pids"
@@ -27,10 +36,6 @@ socket_path="$app_root/tmp/sockets"
web_server_pid_path="$pid_path/unicorn.pid"
sidekiq_pid_path="$pid_path/sidekiq.pid"
-
-
-### Here ends user configuration ###
-
# Read configuration variable file if it is present
test -f /etc/default/gitlab && . /etc/default/gitlab
@@ -39,11 +44,12 @@ if [ "$USER" != "$app_user" ]; then
sudo -u "$app_user" -H -i $0 "$@"; exit;
fi
-# Switch to the gitlab path, if it fails exit with an error.
+# Switch to the gitlab path, exit on failure.
if ! cd "$app_root" ; then
echo "Failed to cd into $app_root, exiting!"; exit 1
fi
+
### Init Script functions
## Gets the pids from the files
diff --git a/lib/support/init.d/gitlab.default.example b/lib/support/init.d/gitlab.default.example
new file mode 100755
index 00000000000..4230783a9d7
--- /dev/null
+++ b/lib/support/init.d/gitlab.default.example
@@ -0,0 +1,14 @@
+# Copy this lib/support/init.d/gitlab.default.example file to
+# /etc/default/gitlab in order for it to apply to your system.
+
+# RAILS_ENV defines the type of installation that is running.
+# Normal values are "production", "test" and "development".
+RAILS_ENV="production"
+
+# app_user defines the user that GitLab is run as.
+# The default is "git".
+app_user="git"
+
+# app_root defines the folder in which gitlab and it's components are installed.
+# The default is "/home/$app_user/gitlab"
+app_root="/home/$app_user/gitlab"