Bug 176995 - [patch] add config testing to net/quagga rc script
Summary: [patch] add config testing to net/quagga rc script
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-15 15:00 UTC by Alexander Brovikov
Modified: 2013-03-29 05:30 UTC (History)
0 users

See Also:


Attachments
file.diff (977 bytes, patch)
2013-03-15 15:00 UTC, Alexander Brovikov
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Brovikov 2013-03-15 15:00:00 UTC

Fix: Attached patch adds config files testing before running start/restart command.

Patch attached with submission follows:
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2013-03-16 07:08:33 UTC
Responsible Changed
From-To: freebsd-bugs->freebsd-ports-bugs

ports PR.
Comment 2 Edwin Groothuis freebsd_committer freebsd_triage 2013-03-16 07:08:50 UTC
Maintainer of net/quagga,

Please note that PR ports/176995 has just been submitted.

If it contains a patch for an upgrade, an enhancement or a bug fix
you agree on, reply to this email stating that you approve the patch
and a committer will take care of it.

The full text of the PR can be found at:
    http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/176995

-- 
Edwin Groothuis via the GNATS Auto Assign Tool
edwin@FreeBSD.org
Comment 3 Edwin Groothuis freebsd_committer freebsd_triage 2013-03-16 07:08:51 UTC
State Changed
From-To: open->feedback

Awaiting maintainers feedback (via the GNATS Auto Assign Tool)
Comment 4 dfilter service freebsd_committer freebsd_triage 2013-03-29 05:20:01 UTC
Author: rm
Date: Fri Mar 29 05:19:51 2013
New Revision: 315520
URL: http://svnweb.freebsd.org/changeset/ports/315520

Log:
  - update to 0.99.22
  
  PR: 177303
  Submitted by:   Boris Kovalenko <boris@tagnet.ru> (maintainer)
  
  - add "--no_kernel" option decription to man-page
  
  PR: 173624
  Reported by:    Rasmus G. Andersen <rga@abiosis.dk>
  
  - add integrated-vtysh-config mode to rc-script
  
  PR: 176223
  Submitted by:   Michael deMan <freebsd@deman.com>
  
  - add config file testing before start/restart in rc-script
  
  PR: 176995
  Submitted by:   Alexander Brovikov <alexander@brovikov.ru>

Added:
  head/net/quagga/files/patch-doc-bgpd.8   (contents, props changed)
Deleted:
  head/net/quagga/files/patch-bgpd__bgp_open.c
Modified:
  head/net/quagga/Makefile   (contents, props changed)
  head/net/quagga/distinfo   (contents, props changed)
  head/net/quagga/files/quagga.in   (contents, props changed)

Modified: head/net/quagga/Makefile
==============================================================================
--- head/net/quagga/Makefile	Fri Mar 29 02:08:23 2013	(r315519)
+++ head/net/quagga/Makefile	Fri Mar 29 05:19:51 2013	(r315520)
@@ -1,14 +1,10 @@
-# New ports collection makefile for:    quagga
-# Date created:         3 September 2003
-# Whom:                 Bruce M Simpson <bms@FreeBSD.org>
-#
+# Created by: Bruce M Simpson <bms@FreeBSD.org>
 # $FreeBSD$
-#
 
 PORTNAME=	quagga
-PORTVERSION=	0.99.21
+PORTVERSION=	0.99.22
 CATEGORIES=	net ipv6
-MASTER_SITES=	${MASTER_SITE_SAVANNAH}
+MASTER_SITES=	SAVANNAH
 MASTER_SITE_SUBDIR=	quagga
 
 PATCH_SITES=	http://quagga.net/
@@ -17,7 +13,6 @@ MAINTAINER=	boris@tagnet.ru
 COMMENT=	Free RIPv1, RIPv2, OSPFv2, BGP4, IS-IS route software
 
 LICENSE=	GPLv2
-LICENSE_FILE=	${WRKSRC}/COPYING
 
 CONFLICTS=	openbgpd-[0-9]* openospfd-[0-9]* zebra-0* quagga-re-[0-9]*
 

Modified: head/net/quagga/distinfo
==============================================================================
--- head/net/quagga/distinfo	Fri Mar 29 02:08:23 2013	(r315519)
+++ head/net/quagga/distinfo	Fri Mar 29 05:19:51 2013	(r315520)
@@ -1,2 +1,2 @@
-SHA256 (quagga-0.99.21.tar.gz) = 9b8aea9026b4771a28e254a66cbd854723bcd0d71eebd0201d11838d4eb392ee
-SIZE (quagga-0.99.21.tar.gz) = 2297174
+SHA256 (quagga-0.99.22.tar.gz) = 5e5f5506e9e53daf785e8bf2dc41ba09a13e6f45b558de4351fe08da8c6a75bd
+SIZE (quagga-0.99.22.tar.gz) = 2351197

Added: head/net/quagga/files/patch-doc-bgpd.8
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net/quagga/files/patch-doc-bgpd.8	Fri Mar 29 05:19:51 2013	(r315520)
@@ -0,0 +1,21 @@
+--- doc/bgpd.8.orig	2012-07-13 23:02:24.000000000 +0600
++++ doc/bgpd.8	2013-03-23 10:08:50.551916290 +0600
+@@ -28,6 +28,8 @@
+ ] [
+ .B \-g
+ .I group
++] [
++.B \--no_kernel
+ ]
+ .SH DESCRIPTION
+ .B bgpd 
+@@ -76,6 +78,9 @@
+ .TP
+ \fB\-v\fR, \fB\-\-version\fR
+ Print the version and exit.
++.TP
++\fB\--no_kernel\fR
++Prevents route updates to be submitted to the kernel.
+ .SH FILES
+ .TP
+ .BI /usr/local/sbin/bgpd

Modified: head/net/quagga/files/quagga.in
==============================================================================
--- head/net/quagga/files/quagga.in	Fri Mar 29 02:08:23 2013	(r315519)
+++ head/net/quagga/files/quagga.in	Fri Mar 29 05:19:51 2013	(r315520)
@@ -13,6 +13,7 @@
 # You may also wish to use the following variables to fine-tune startup:
 #  quagga_flags="-d"
 #  quagga_daemons="zebra ripd ripngd ospfd ospf6d bgpd isisd"
+#  quagga_vysh_boot="YES"
 # Per daemon tuning may be done with daemon_name_flags
 #  zebra_flags="-dP 0"
 #  bgpd_flags="-dnrP 0" and so on
@@ -32,6 +33,20 @@ rcvar=quagga_enable
 
 start_postcmd=start_postcmd
 stop_postcmd=stop_postcmd
+configtest_cmd=check_config
+extra_commands="configtest"
+
+check_config() {
+    echo "Checking $daemon.conf"
+    $command $daemon_flags -C
+    result=$?
+    if [ "$result" -eq "0" ]; then
+	echo "OK"
+    else
+	echo "FAILED"
+	exit
+    fi
+}
 
 start_postcmd()
 {
@@ -61,6 +76,9 @@ do_cmd()
 	    command=%%PREFIX%%/sbin/${daemon}
 	    required_files=%%SYSCONF_DIR%%/${daemon}.conf
 	    pidfile=%%LOCALSTATE_DIR%%/${daemon}.pid
+	    if [ ${quagga_cmd} = "restart" -o ${quagga_cmd} = "start" ]; then
+		check_config
+	    fi
 	    if [ ${quagga_cmd} = "start" -a ! -f ${required_files} ]; then
 			continue
 	    fi
@@ -72,6 +90,10 @@ do_cmd()
 	    _rc_restart_done=false
 	    run_rc_command "$1" || ret=1
 	done
+	if checkyesno quagga_vtysh_boot; then
+	    echo "Booting for integrated-vtysh-config..."
+	    %%PREFIX%%/bin/vtysh -b
+	fi
 	return ${ret}
 }
 
@@ -82,6 +104,7 @@ load_rc_config $name
 : ${quagga_enable="NO"}
 : ${quagga_flags="-d"}
 : ${quagga_daemons="zebra ripd ripngd ospfd ospf6d bgpd isisd"}
+: ${quagga_vtysh_boot="NO"}
 
 quagga_cmd=$1
 
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 5 Ruslan Makhmatkhanov freebsd_committer freebsd_triage 2013-03-29 05:21:27 UTC
State Changed
From-To: feedback->closed

Committed, thanks.