Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 17 Sep 2017 01:43:06 +0000 (UTC)
From:      Steve Wills <swills@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r449980 - in head/sysutils/consul: . files
Message-ID:  <201709170143.v8H1h66w076271@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: swills
Date: Sun Sep 17 01:43:06 2017
New Revision: 449980
URL: https://svnweb.freebsd.org/changeset/ports/449980

Log:
  sysutils/consul: check config in rc.d script
  
  PR:		221732
  Submitted by:	thompsa

Modified:
  head/sysutils/consul/Makefile
  head/sysutils/consul/files/consul.in

Modified: head/sysutils/consul/Makefile
==============================================================================
--- head/sysutils/consul/Makefile	Sun Sep 17 01:34:38 2017	(r449979)
+++ head/sysutils/consul/Makefile	Sun Sep 17 01:43:06 2017	(r449980)
@@ -2,6 +2,7 @@
 
 PORTNAME=	consul
 PORTVERSION=	0.9.3
+PORTREVISION=	1
 DISTVERSIONPREFIX=	v
 CATEGORIES=	sysutils
 

Modified: head/sysutils/consul/files/consul.in
==============================================================================
--- head/sysutils/consul/files/consul.in	Sun Sep 17 01:34:38 2017	(r449979)
+++ head/sysutils/consul/files/consul.in	Sun Sep 17 01:43:06 2017	(r449980)
@@ -22,7 +22,7 @@
 
 name=consul
 rcvar=consul_enable
-extra_commands="reload"
+extra_commands="reload configtest"
 
 load_rc_config $name
 
@@ -37,6 +37,10 @@ command="/usr/sbin/daemon"
 command_args="-f -p ${pidfile} /usr/bin/env ${consul_env} ${procname} agent -data-dir=${consul_dir} -config-dir=%%PREFIX%%/etc/consul.d ${consul_args}"
 
 start_precmd=consul_startprecmd
+restart_precmd=consul_checkconfig
+reload_precmd=consul_checkconfig
+configtest_cmd=consul_checkconfig
+upgrade_precmd=consul_checkconfig
 
 consul_startprecmd()
 {
@@ -47,7 +51,12 @@ consul_startprecmd()
         if [ ! -d ${consul_dir} ]; then
                 install -d -o ${consul_user} -g ${consul_group} ${consul_dir}
         fi
+	consul_checkconfig
+}
 
+consul_checkconfig()
+{
+	${procname} validate /usr/local/etc/consul.d
 }
 
 run_rc_command "$1"



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