diff --git a/debian/changelog b/debian/changelog index 03334dc85f..1262314290 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 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 fac22a52a7..0bd0e93ded 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 c9f1ead988..d8f4371b2b 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}