Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 23 Aug 2017 03:39:51 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-ports-bugs@FreeBSD.org
Subject:   [Bug 221732] sysutils/consul - check config in rc.d script
Message-ID:  <bug-221732-13@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D221732

            Bug ID: 221732
           Summary: sysutils/consul - check config in rc.d script
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: Individual Port(s)
          Assignee: swills@FreeBSD.org
          Reporter: thompsa@FreeBSD.org
          Assignee: swills@FreeBSD.org
             Flags: maintainer-feedback?(swills@FreeBSD.org)

Consul will silently fail to load if there is a syntax error in the config,=
 add
a precheck to catch this.


--- /usr/local/etc/rc.d/consul  2017-07-19 10:19:37.000000000 +1200
+++ /tmp/puppet-file20170823-57649-2mf3pd       2017-08-23 15:29:05.9859066=
60
+1200
@@ -22,7 +22,7 @@

 name=3Dconsul
 rcvar=3Dconsul_enable
-extra_commands=3D"reload"
+extra_commands=3D"reload configtest"

 load_rc_config $name

@@ -37,6 +37,10 @@
 command_args=3D"-f -p ${pidfile} /usr/bin/env ${consul_env} ${procname} ag=
ent
-data-dir=3D${consul_dir} -config-dir=3D/usr/local/etc/consul.d ${consul_ar=
gs}"

 start_precmd=3Dconsul_startprecmd
+restart_precmd=3Dconsul_checkconfig
+reload_precmd=3Dconsul_checkconfig
+configtest_cmd=3Dconsul_checkconfig
+upgrade_precmd=3Dconsul_checkconfig

 consul_startprecmd()
 {
@@ -47,7 +51,12 @@
         if [ ! -d ${consul_dir} ]; then
                 install -d -o ${consul_user} -g ${consul_group} ${consul_d=
ir}
         fi
+       consul_checkconfig
+}

+consul_checkconfig()
+{
+       ${procname} validate /usr/local/etc/consul.d
 }

 run_rc_command "$1"

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-221732-13>