[DRE-commits] [gitlab] 01/01: Fix problems with gitlab_user not set

Balasankar C balasankarc-guest at moszumanska.debian.org
Fri Feb 24 07:35:43 UTC 2017


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

balasankarc-guest pushed a commit to branch master
in repository gitlab.

commit ac1dd4c0e1770effe3e949ecb5660b22db7e5fa4
Author: Balasankar C <balasankarc at autistici.org>
Date:   Fri Feb 24 13:05:34 2017 +0530

    Fix problems with gitlab_user not set
---
 debian/postrm | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/debian/postrm b/debian/postrm
index ddb07e6..ae6f1c7 100644
--- a/debian/postrm
+++ b/debian/postrm
@@ -53,13 +53,19 @@ case "$1" in
         rm -rf ${gitlab_log_dir}
         rm -rf ${gitlab_cache_path}
         rm -rf ${gitlab_pid_path}
+        rm -rf ${gitlab_data_dir}
         if [ ! -z "${gitlab_user}" ]; then
             # Do only if gitlab_user is set
+            if [ -x /usr/bin/dropdb ]; then
+                echo "Removing Database"
+                su ${gitlab_user} -c 'psql gitlab_production -c ""' && su postgres -c "dropdb gitlab_production"
+            else
+                echo "dropdb command not found. Hence not removing database."
+             echo "Removing ${gitlab_user}"
             id -u ${gitlab_user} && userdel -r ${gitlab_user}
-        fi
-        rm -rf ${gitlab_data_dir}
-        if [ -x /usr/bin/dropdb ]; then
-            su ${gitlab_user} -c 'psql gitlab_production -c ""' && su postgres -c "dropdb gitlab_production"
+           fi
+        else
+            echo "gitlab_user not set. Hence not removing user."
         fi
         rm -rf ${gitlab_ssl_path}
       fi

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