[DRE-commits] [gitlab] 14/16: read gitlab_user from debconf
Praveen Arimbrathodiyil
praveen at moszumanska.debian.org
Thu Feb 16 12:09:32 UTC 2017
This is an automated email from the git hooks/post-receive script.
praveen pushed a commit to branch master
in repository gitlab.
commit 585d4a4df223435287c4a0e3849d1ebb67a53acd
Author: Praveen Arimbrathodiyil <praveen at debian.org>
Date: Thu Feb 16 16:35:08 2017 +0530
read gitlab_user from debconf
---
debian/adduser.sh | 6 +++---
debian/conf/gitlab-debian.conf.example | 1 -
debian/postinst | 8 ++++++++
3 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/debian/adduser.sh b/debian/adduser.sh
index 5c484e2..8d9ea8e 100755
--- a/debian/adduser.sh
+++ b/debian/adduser.sh
@@ -8,9 +8,9 @@ test -n "${gitlab_user}" || gitlab_user="gitlab"
# Create gitlab user with home in /var/lib
echo "Creating/updating ${gitlab_user} user account..."
-adduser --system --home /var/lib/${gitlab_user} --gecos "${gitlab_user} user" --shell /bin/sh \
+adduser --system --home ${gitlab_data_dir} --gecos "${gitlab_user} user" --shell /bin/sh \
--quiet --disabled-password --group ${gitlab_user} || {
echo "Proceeding with existing ${gitlab_user} user..."
}
-echo "Making ${gitlab_user} owner of /var/lib/${gitlab_user}..."
-chown -R ${gitlab_user} /var/lib/${gitlab_user}
+echo "Making ${gitlab_user} owner of ${gitlab_data_dir}..."
+chown -R ${gitlab_user} ${gitlab_data_dir}
diff --git a/debian/conf/gitlab-debian.conf.example b/debian/conf/gitlab-debian.conf.example
index fc938d5..b849733 100644
--- a/debian/conf/gitlab-debian.conf.example
+++ b/debian/conf/gitlab-debian.conf.example
@@ -1,6 +1,5 @@
RAILS_ENV=production
DB=postgres
-gitlab_user=gitlab
gitlab_app_root=/usr/share/gitlab
gitlab_data_dir=/var/lib/gitlab
gitlab_cache_path=/var/cache/gitlab
diff --git a/debian/postinst b/debian/postinst
index ad77519..0359968 100755
--- a/debian/postinst
+++ b/debian/postinst
@@ -44,6 +44,14 @@ export $(cat ${gitlab_debian_conf_private})
# If /etc/gitlab/gitlab-debian.conf is already present, use it
test -f ${gitlab_debian_conf} && export $(cat ${gitlab_debian_conf})
+# Read gitlab_user from debconf db
+db_get gitlab/user
+gitlab_user=${RET:-gitlab} >/dev/null
+
+if ! grep gitlab_user ${gitlab_debian_conf_private}; then
+ echo "gitlab_user=${gitlab_user}" >> ${gitlab_debian_conf_private}
+fi
+
# Create gitlab user
. /usr/lib/gitlab/scripts/adduser.sh
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/gitlab.git
More information about the Pkg-ruby-extras-commits
mailing list