Bug 243860 - www/gitlab-ce rc.d script does not support rcvar subcommand
Summary: www/gitlab-ce rc.d script does not support rcvar subcommand
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Matthias Fechner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-02-04 03:54 UTC by amendlik
Modified: 2020-02-17 19:05 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description amendlik 2020-02-04 03:54:48 UTC
The rc.d script that ships with www/gitlab-ce does not support the rcvar subcommand, as in: 

# service gitlab rcvar

This causes a problem for configuration management tools (Chef, Puppet, Salt, Ansible, etc.) because they depend on the rcvar subcommand to be present to determine the variable name when enabling/disabling services.

I believe the entire input handling section of the rc.d script can be replaced with a call to 'run_rc_command'. It provides support for start, stop, restart, status, rcvar, and more.

     ### Finally the input handling.
    -
    -case $gitlab_enable in
    -  [yY][eE][sS])
    -    case "$1" in
    -      start|quietstart|faststart)
    -        start_gitlab
    -        ;;
    -      stop|faststop)
    -        stop_gitlab
    -        ;;
    -      restart)
    -        restart_gitlab
    -        ;;
    -      reload|force-reload)
    -     reload_gitlab
    -        ;;
    -      status)
    -        print_status
    -        exit $gitlab_status
    -        ;;
    -      *)
    -        echo "Usage: service gitlab {start|quietstart|faststop|stop|restart|reload|onestart|onestop|onerestart|onreload|status}"
    -        exit 1
    -        ;;
    -    esac
    -    ;;
    -  *)
    -    case "$1" in
    -      onestart)
    -        start_gitlab
    -        ;;
    -      onestop)
    -        stop_gitlab
    -        ;;
    -      onerestart)
    -        restart_gitlab
    -        ;;
    -      onreload)
    -        reload_gitlab
    -        ;;
    -      status)
    -        print_status
    -        exit $gitlab_status
    -        ;;
    -      *)
    -        echo "Usage: service gitlab {start|quietstart|faststop|stop|restart|reload|onestart|onestop|onerestart|onreload|status}"
    -        exit 1
    -        ;;
    -    esac
    -esac
    +run_rc_command "$1"
Comment 1 commit-hook freebsd_committer 2020-02-04 20:35:09 UTC
A commit references this bug:

Author: mfechner
Date: Tue Feb  4 20:34:58 UTC 2020
New revision: 525233
URL: https://svnweb.freebsd.org/changeset/ports/525233

Log:
  Use the standard RC system available in FreeBSD.
  This makes some commands like:
  service gitlab rcvar
  available. This is required by configuration management tools like Chef, Puppetm, Salt,
  Ansible and more.

  PR:		243860
  Reported by:	amendlik@gmail.com

Changes:
  head/www/gitlab-ce/Makefile
  head/www/gitlab-ce/files/gitlab.in
Comment 2 Matthias Fechner freebsd_committer 2020-02-04 20:35:31 UTC
Thanks a lot, committed.
Comment 3 commit-hook freebsd_committer 2020-02-17 19:05:01 UTC
A commit references this bug:

Author: mfechner
Date: Mon Feb 17 19:04:01 UTC 2020
New revision: 526404
URL: https://svnweb.freebsd.org/changeset/ports/526404

Log:
  MFH: r524831 r525233 r526069

  Update to 12.7.5.
  Changelog:
  https://about.gitlab.com/releases/2020/01/22/gitlab-12-7-released/
  https://about.gitlab.com/releases/2020/01/24/gitlab-12-7-2-released/
  https://about.gitlab.com/releases/2020/01/30/security-release-gitlab-12-7-4-released/
  https://about.gitlab.com/releases/2020/01/31/gitlab-12-7-5-released/

  Use the standard RC system available in FreeBSD.
  This makes some commands like:
  service gitlab rcvar
  available. This is required by configuration management tools like Chef, Puppetm, Salt,
  Ansible and more.

  PR:		243860
  Reported by:	amendlik@gmail.com

  Security update to 12.7.6.
  Changelog:
  https://about.gitlab.com/releases/2020/02/13/critical-security-release-gitlab-12-dot-7-dot-6-released/

  Security:	1ece5591-4ea9-11ea-86f0-001b217b3468

  Approved by:	ports-secteam (joneum)

Changes:
_U  branches/2020Q1/
  branches/2020Q1/www/gitlab-ce/Makefile
  branches/2020Q1/www/gitlab-ce/distinfo
  branches/2020Q1/www/gitlab-ce/files/gitlab.in
  branches/2020Q1/www/gitlab-ce/files/patch-Gemfile
  branches/2020Q1/www/gitlab-ce/files/patch-config_gitlab.yml.example
  branches/2020Q1/www/gitlab-ce/files/patch-config_initializers_1__settings.rb
  branches/2020Q1/www/gitlab-ce/pkg-message
  branches/2020Q1/www/gitlab-ce/pkg-plist