[DRE-commits] [gitlab] 02/02: copy adduser.sh from diaspora-common
Praveen Arimbrathodiyil
praveen at moszumanska.debian.org
Thu Sep 24 07:13:24 UTC 2015
This is an automated email from the git hooks/post-receive script.
praveen pushed a commit to branch master
in repository gitlab.
commit 28059229b20fd9a325cf1de300bc07a67770a170
Author: Praveen Arimbrathodiyil <praveen at debian.org>
Date: Thu Sep 24 12:14:52 2015 +0530
copy adduser.sh from diaspora-common
---
debian/adduser.sh | 19 +++++++++++++++++++
debian/install | 1 +
debian/postinst | 3 ++-
3 files changed, 22 insertions(+), 1 deletion(-)
diff --git a/debian/adduser.sh b/debian/adduser.sh
new file mode 100755
index 0000000..1deaae7
--- /dev/null
+++ b/debian/adduser.sh
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+# add diaspora system user (requires adduser >= 3.34)
+# don't muck around with this unless you KNOW what you're doing
+user=gitlab
+
+echo "Creating/updating $user user account..."
+adduser --system --home /usr/share/$user \
+ --gecos "$user system user" --shell /bin/false \
+ --quiet --disabled-password --disabled-login $user || {
+ # adduser failed. Why?
+ if [ `getent passwd $user|awk -F ':' '{print $3}'` -gt 999 ] >/dev/null ; then
+ echo "Non-system user $user found. I will not overwrite a non-system" >&2
+ echo "user. Remove the user and reinstall diaspora." >&2
+ exit 1
+ fi
+ # unknown adduser error, simply exit
+ exit 1
+ }
diff --git a/debian/install b/debian/install
index f85a93f..1e38527 100644
--- a/debian/install
+++ b/debian/install
@@ -1,4 +1,5 @@
debian/gitlab-debian.conf etc/gitlab
+debian/adduser.sh usr/lib/gitlab/scripts
app usr/share/gitlab
bin usr/share/gitlab
CHANGELOG usr/share/gitlab
diff --git a/debian/postinst b/debian/postinst
index 80c794d..e8d57d2 100755
--- a/debian/postinst
+++ b/debian/postinst
@@ -30,8 +30,9 @@ case "$1" in
configure)
. /etc/gitlab/gitlab-debian.conf
+ . /usr/lib/gitlab/scripts/adduser.sh
chown -R ${gitlab_user}: ${gitlab_home}
- cd ${diaspora_home}
+ cd ${gitlab_home}
echo "Setting up environment varibales..."
export RAILS_ENV=production
--
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