Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 15 Jan 2019 17:43:31 +0000 (UTC)
From:      Ryan Steinmetz <zi@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r490392 - in head/net/exabgp: . files
Message-ID:  <201901151743.x0FHhVRS099992@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: zi
Date: Tue Jan 15 17:43:31 2019
New Revision: 490392
URL: https://svnweb.freebsd.org/changeset/ports/490392

Log:
  - Add config validation to rc script
  - Fix broken CLI
  - Update env file with current defaults
  - Bump PORTREVISION

Modified:
  head/net/exabgp/Makefile
  head/net/exabgp/files/exabgp.env
  head/net/exabgp/files/exabgp.in
  head/net/exabgp/files/exabgp.sh.in

Modified: head/net/exabgp/Makefile
==============================================================================
--- head/net/exabgp/Makefile	Tue Jan 15 17:16:05 2019	(r490391)
+++ head/net/exabgp/Makefile	Tue Jan 15 17:43:31 2019	(r490392)
@@ -3,6 +3,7 @@
 
 PORTNAME=	exabgp
 PORTVERSION=	3.4.25
+PORTREVISION=	1
 CATEGORIES=	net
 MASTER_SITES=	GH \
 		ZI

Modified: head/net/exabgp/files/exabgp.env
==============================================================================
--- head/net/exabgp/files/exabgp.env	Tue Jan 15 17:16:05 2019	(r490391)
+++ head/net/exabgp/files/exabgp.env	Tue Jan 15 17:43:31 2019	(r490392)
@@ -1,6 +1,19 @@
+[exabgp.api]
+encoder = text
+highres = false
+respawn = false
+socket = ''
 
+[exabgp.bgp]
+openwait = 60
+
+[exabgp.cache]
+attributes = true
+nexthops = true
+
 [exabgp.daemon]
 daemonize = true
+drop = true
 pid = '/var/run/exabgp/exabgp.pid'
 user = '_bgpd'
 
@@ -16,10 +29,10 @@ network = true
 packets = false
 parser = false
 processes = true
+reactor = true
 rib = false
 routes = false
 short = false
-supervisor = true
 timers = false
 
 [exabgp.pdb]
@@ -29,5 +42,12 @@ enable = false
 enable = false
 file = ''
 
+[exabgp.reactor]
+speed = 1.0
+
 [exabgp.tcp]
-timeout = 1
+acl = false
+bind = ''
+delay = 0
+once = false
+port = 179

Modified: head/net/exabgp/files/exabgp.in
==============================================================================
--- head/net/exabgp/files/exabgp.in	Tue Jan 15 17:16:05 2019	(r490391)
+++ head/net/exabgp/files/exabgp.in	Tue Jan 15 17:43:31 2019	(r490392)
@@ -24,34 +24,40 @@ pidfile=/var/run/${name}/${name}.pid
 
 required_files=${exabgp_conf}
 
-command="%%PYTHON_SITELIBDIR%%/${name}/application/bgp.py"
-procname="%%PYTHON_CMD%%"
+command="%%PYTHON_CMD%%"
+command_args="-m exabgp --folder /usr/local/etc/exabgp ${exabgp_conf}"
 
-start_cmd="exabgp_start"
+configtest_cmd="exabgp_configtest"
+start_precmd="exabgp_precmd"
+reload_precmd="exabgp_configtest"
+restart_precmd="exabgp_configtest"
 reload_all_cmd="exabgp_reload_all"
-extra_commands="reload reload_all"
+reload_all_precmd="exabgp_configtest"
+extra_commands="configtest reload reload_all"
 sig_reload="USR1"
 
-exabgp_start()
+exabgp_reload_all()
 {
-	if [ -z "$rc_fast" -a -n "$rc_pid" ]; then
-		echo 1>&2 "${name} already running? (pid=$rc_pid)."
-		return 1
+    	echo "Reloading exabgp configuration and processes."
+	kill -USR2 $rc_pid
+}
+
+exabgp_configtest()
+{
+	echo "Performing sanity check on ${name} configuration."
+	result=$(env exabgp.log.configuration=true exabgp.daemon.daemonize=false exabgp.log.level=ERR exabgp.log.destination=stdout ${command} -m ${name} --folder /usr/local/etc/exabgp -t ${exabgp_conf} 2>&1)
+	if [ ! -z "${result}" ]; then
+		echo "${result}"
+		err 1 "Failed to validate configuration file, aborting."
 	fi
+}
 
-	echo "Starting ${name}."
-
+exabgp_precmd()
+{
+	exabgp_configtest
 	install -d -o _bgpd -g _bgpd -m 755 /var/run/${name}
 	install -d -o _bgpd -g _bgpd -m 755 /var/log/${name}
 	rm -f ${pidfile}
-
-	${procname} ${command} --folder %%ETCDIR%% ${exabgp_conf}
-}
-
-exabgp_reload_all()
-{
-    	echo "Reloading exabgp configuration and processes."
-	kill -USR2 $rc_pid
 }
 
 run_rc_command "$1"

Modified: head/net/exabgp/files/exabgp.sh.in
==============================================================================
--- head/net/exabgp/files/exabgp.sh.in	Tue Jan 15 17:16:05 2019	(r490391)
+++ head/net/exabgp/files/exabgp.sh.in	Tue Jan 15 17:43:31 2019	(r490392)
@@ -8,9 +8,9 @@ APPLICATIONS=`$INTERPRETER -c "import sys,os; print ' 
 APPLICATION=`echo $APPLICATIONS | awk '{ print $1; }'`
 
 if [ $# -eq 0 ]; then
-	$INTERPRETER -m exabgp.debug $APPLICATION --folder %%PREFIX%%/etc/exabgp --help
+	$INTERPRETER -m exabgp $APPLICATION --folder %%PREFIX%%/etc/exabgp --help
 	echo "===> To start exabgp, you should use:"
 	echo "===>   service exabgp start"
 else
-	exec $INTERPRETER -m exabgp.debug $APPLICATION --folder %%PREFIX%%/etc/exabgp $*
+	exec $INTERPRETER -m exabgp $APPLICATION --folder %%PREFIX%%/etc/exabgp $*
 fi



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