[DRE-commits] [gitlab] 01/01: fix failure to start masked gitlab.service after reinstall.

Dmitry Smirnov onlyjob at moszumanska.debian.org
Mon Sep 26 03:58:50 UTC 2016


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

onlyjob pushed a commit to branch master
in repository gitlab.

commit be29983 (HEAD, master)
Author: Dmitry Smirnov <onlyjob at member.fsf.org>
Date:   Mon Sep 26 03:43:37 2016

    fix failure to start masked gitlab.service after reinstall.
    
     Essentially problem is due to L:maintainer-script-should-not-use-service [1]:
     postinst invoke `rake-tasks.sh` which tries to start gitlab using "service gitlab start"
     before debhelper-generated scripts that unmask "gitlab.service".
    
     This commit modifies postinst to run "rake gitlab:check" after #DEBHELPER#
     scripts that take care of starting GitLab (which is no longer started by
     `rake-tasks.sh`).
    
     [1]: https://lintian.debian.org/tags/maintainer-script-should-not-use-service.html
---
 debian/postinst      |  7 ++++++-
 debian/rake-tasks.sh | 21 +++++++++++++--------
 2 files changed, 19 insertions(+), 9 deletions(-)

diff --git a/debian/postinst b/debian/postinst
index b11e3ef..800a18e 100755
--- a/debian/postinst
+++ b/debian/postinst
@@ -237,4 +237,9 @@ esac
 
 #DEBHELPER#
 
-exit 0
+case "$1" in
+  configure)
+    echo "Running rake checks..."
+    . /usr/lib/gitlab/scripts/rake-tasks.sh check
+  ;;
+esac
diff --git a/debian/rake-tasks.sh b/debian/rake-tasks.sh
index 15f2a92..07ec338 100755
--- a/debian/rake-tasks.sh
+++ b/debian/rake-tasks.sh
@@ -3,6 +3,18 @@
 # Only exported variables will be passed on to gitlab app
 export $(cat /etc/gitlab/gitlab-debian.conf)
 
+glcheck() {
+    # Check gitlab is configured correctly
+    printf "Check if Gitlab is configured correctly...\n"
+    su ${gitlab_user} -s /bin/sh -c 'bundle exec rake gitlab:check RAILS_ENV=production'
+}
+
+if [ "$1" = "check" ]; then
+    glcheck
+    exit
+fi
+
+
 if ! [ -f "${gitlab_app_root}/config/secrets.yml" ]; then
   echo "Creating secrets.yml..."
   cd ${gitlab_app_root}
@@ -26,11 +38,4 @@ chmod 0700 ${gitlab_data_dir}/.gitlab_shell_secret
 echo "Precompiling assets..."
 su ${gitlab_user} -s /bin/sh -c 'bundle exec rake tmp:cache:clear assets:precompile RAILS_ENV=production'
 
-# Start gitlab
-printf "Starting GitLab...\n"
-service gitlab start
-
-# Check gitlab is configured correctly
-printf "Check if Gitlab is configured correctly...\n"
-su ${gitlab_user} -s /bin/sh -c 'bundle exec rake gitlab:check RAILS_ENV=production'
-
+glcheck

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