copy adduser.sh from diaspora-common

This commit is contained in:
Praveen Arimbrathodiyil 2015-09-24 12:14:52 +05:30
parent 81b08e2a3e
commit 28059229b2
3 changed files with 22 additions and 1 deletions

19
debian/adduser.sh vendored Executable file
View file

@ -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
}

1
debian/install vendored
View file

@ -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

3
debian/postinst vendored
View file

@ -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