Bug 220126 - www/gitlab: gitlab starts even when gitlab_enable is not set
Summary: www/gitlab: gitlab starts even when gitlab_enable is not set
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: Matthias Fechner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-06-19 07:27 UTC by Marián Černý
Modified: 2017-12-12 10:56 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (tz)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marián Černý 2017-06-19 07:27:05 UTC
I have a portbuild jail where I do not have gitlab_enable set and gitlab is trying to start even when gitlab_enable is not set.

I have added some debug prints to /usr/local/etc/rc.d/gitlab and it clearly show that gitlab_enable is not set (shows the default value NO).

root@portbuild:/usr/local/etc/rc.d # service gitlab start
NO
starting
Starting GitLab Unicorn
Starting GitLab Sidekiq
Starting gitlab-workhorse
Could not find minitest-5.10.1 in any of the sources
Run `bundle install` to install missing gems.
..............................Waited 30s for the processes to write their pids, something probably went wrong.
Comment 1 Torsten Zuehlsdorff freebsd_committer 2017-06-28 11:32:58 UTC
Hello,

yes, i can reproduce the bug. But the fix will cause a heavy rewriting of the service-file, which will take a while.
Comment 2 Marián Černý 2017-10-06 13:05:03 UTC
What about adding the following code:

    # Do not start gitlab if not enabled in rc.conf. 
    case $gitlab_enable in 
      [yY][eE][sS]) 
            ;; 
      *) 
            exit
            ;;
    esac

somewhere at the start of the file (e.g. right before # Read configuration variable file if it is present).

That is quite simple fix and it does not seem to break anything (it works for me).
Comment 3 Torsten Zuehlsdorff freebsd_committer 2017-12-06 15:34:38 UTC
Submit to new Maintainer. :)

I'm in CC if something needs to be committed.
Comment 4 Matthias Fechner freebsd_committer 2017-12-09 09:56:37 UTC
Thanks for this. I already included it together with a security update.
Patch is on its way.
Comment 5 commit-hook freebsd_committer 2017-12-12 10:54:47 UTC
A commit references this bug:

Author: tz
Date: Tue Dec 12 10:54:13 UTC 2017
New revision: 456116
URL: https://svnweb.freebsd.org/changeset/ports/456116

Log:
  www/gitlab: Update from 10.1.4 to 10.1.5

  Also:
  - remove %%RUBY_SUFFIX%% from plist (thanks to swills)
  - fix broken dependency to rubygem-pg in Gemfile
  - fix broken dependency to rubygem-mysql2 in Gemfile
  - Add support for reverse proxies in rc script
  - Fix: gitlab starts even if gitlab_enable is not set
  - Make default listenAddr configurable

  PR:           224232 222896 220126 218388
  Submitted by: swills, gdinolt@pacbell.net, max@mober.at, Mari?n ?ern? <majo-bugs.freebsd.org@cerny.sk>
  Reviewed by:  tz
  Approved by:  maintainer
  Differential Revision:	https://reviews.freebsd.org/D12376

Changes:
  head/www/gitlab/Makefile
  head/www/gitlab/distinfo
  head/www/gitlab/files/gitlab.in
  head/www/gitlab/files/patch-Gemfile
  head/www/gitlab/files/patch-config_database.yml.postgresql
  head/www/gitlab/pkg-plist