From owner-svn-ports-all@freebsd.org Tue Jan 15 17:43:32 2019 Return-Path: Delivered-To: svn-ports-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C21F414917E4; Tue, 15 Jan 2019 17:43:32 +0000 (UTC) (envelope-from zi@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6442369C34; Tue, 15 Jan 2019 17:43:32 +0000 (UTC) (envelope-from zi@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5795F1E371; Tue, 15 Jan 2019 17:43:32 +0000 (UTC) (envelope-from zi@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0FHhWm2099996; Tue, 15 Jan 2019 17:43:32 GMT (envelope-from zi@FreeBSD.org) Received: (from zi@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0FHhVRS099992; Tue, 15 Jan 2019 17:43:31 GMT (envelope-from zi@FreeBSD.org) Message-Id: <201901151743.x0FHhVRS099992@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zi set sender to zi@FreeBSD.org using -f From: Ryan Steinmetz Date: Tue, 15 Jan 2019 17:43:31 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r490392 - in head/net/exabgp: . files X-SVN-Group: ports-head X-SVN-Commit-Author: zi X-SVN-Commit-Paths: in head/net/exabgp: . files X-SVN-Commit-Revision: 490392 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6442369C34 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jan 2019 17:43:33 -0000 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