[DRE-commits] [gitlab] 01/07: remove sudo

Praveen Arimbrathodiyil praveen at moszumanska.debian.org
Fri Jan 29 17:57:08 UTC 2016


This is an automated email from the git hooks/post-receive script.

praveen pushed a commit to branch master
in repository gitlab.

commit 801c0bccf6f8bdc476cd2b721d5f50cd64395ef6
Author: Praveen Arimbrathodiyil <praveen at debian.org>
Date:   Fri Jan 29 21:37:47 2016 +0530

    remove sudo
---
 debian/changelog    |  6 ++++++
 debian/grantpriv.sh | 10 ++++------
 debian/postinst     |  2 +-
 3 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 03334dc..1262314 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+gitlab (8.4.0+dfsg~rc2-5) UNRELEASED; urgency=medium
+
+  * Use su instead of sudo everywhere (Closes: #812951) 
+
+ -- Pirate Praveen <praveen at debian.org>  Fri, 29 Jan 2016 21:36:55 +0530
+
 gitlab (8.4.0+dfsg~rc2-4) unstable; urgency=medium
 
   * Reupload to unstable
diff --git a/debian/grantpriv.sh b/debian/grantpriv.sh
index fac22a5..0bd0e93 100755
--- a/debian/grantpriv.sh
+++ b/debian/grantpriv.sh
@@ -5,23 +5,21 @@ dbname=gitlab_production
 
 # If gitlab user cannot access gitlab_production,
 # then it means the gitlab role does not exist
-if ! su gitlab -s /bin/sh -c 'psql gitlab_production -c ""'
+if ! su gitlab -c 'psql gitlab_production -c ""'
 then
 	echo "Create $user user with create database privillege..."
-	sudo -u postgres psql -c "CREATE USER $user CREATEDB;" || {
+	su postgres -c 'psql -c "CREATE USER $user CREATEDB;"' || {
 	  exit 1 
 	  }
 fi
 
 # By default the gitlab_prodcution is not owned by gitlab user
 echo "Make $user user owner of $dbname database..."
-sudo -u postgres psql -c "ALTER DATABASE $dbname OWNER to $user;" || {
+su postgres -c 'psql -c "ALTER DATABASE $dbname OWNER to $user;"' || {
   exit 1 
   }
 
 echo "Grant all privileges to $user user..."
-sudo -u postgres psql -c "GRANT ALL PRIVILEGES ON DATABASE template1 to $user;"|| {
+su postgres -c 'psql -c "GRANT ALL PRIVILEGES ON DATABASE template1 to $user;"' || {
   exit 1
   }
-
-
diff --git a/debian/postinst b/debian/postinst
index c9f1ead..d8f4371 100755
--- a/debian/postinst
+++ b/debian/postinst
@@ -38,7 +38,7 @@ case "$1" in
 	mkdir -p ${gitlab_repo_path}
 	chmod -R ug+rwX,o-rwx ${gitlab_repo_path}/
 	chmod -R ug-s ${gitlab_repo_path}/
-	find ${gitlab_repo_path}/ -type d -print0 | sudo xargs -0 chmod g+s
+	find ${gitlab_repo_path}/ -type d -print0 | xargs -0 chmod g+s
 	chown -R ${gitlab_user}: ${gitlab_home}
 	chown -R ${gitlab_user}: ${gitlab_data_dir}
 

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