From 47ae37c5a50a4cbf860e2928f98c6119d820defd Mon Sep 17 00:00:00 2001 From: doktornotor Date: Wed, 25 Jan 2017 11:22:31 +0100 Subject: [PATCH 1/4] Quagga_OSPF - Attempt to work around Bug #6305 Quagga 1.x does not like to be killed with SIGKILL. Try to kill it more gracefully. If everything fails, eventually force a SIGKILL on (re)start because otherwise things breaks completely. --- .../files/usr/local/pkg/quagga_ospfd.inc | 25 ++++++++++++++++--- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/net/pfSense-pkg-Quagga_OSPF/files/usr/local/pkg/quagga_ospfd.inc b/net/pfSense-pkg-Quagga_OSPF/files/usr/local/pkg/quagga_ospfd.inc index 509e6a0ff20f..95ffd4c40958 100644 --- a/net/pfSense-pkg-Quagga_OSPF/files/usr/local/pkg/quagga_ospfd.inc +++ b/net/pfSense-pkg-Quagga_OSPF/files/usr/local/pkg/quagga_ospfd.inc @@ -303,11 +303,15 @@ EOF; // Create rc.d file $rc_file_stop = <</dev/null -/usr/bin/killall -9 ospfd 2>/dev/null +# XXX: See Bug #6305 - Quagga 1.x does not like SIGKILL +#/usr/bin/killall -9 zebra 2>/dev/null +#/usr/bin/killall -9 ospfd 2>/dev/null sleep 1 +pidnum="$(/bin/pgrep zebra)" +if [ ! -z "\${pidnum}" ]; then + /usr/bin/killall zebra + sleep 1 + /usr/bin/killall -9 zebra 2>/dev/null +fi +pidnum="$(/bin/pgrep ospfd)" +if [ ! -z "\${pidnum}" ]; then + /usr/bin/killall ospfd + sleep 1 + /usr/bin/killall -9 ospfd 2>/dev/null +fi {$carp_ip_status_check} /usr/local/sbin/zebra -d -f {$quagga_config_base}/zebra.conf /usr/local/sbin/ospfd -d -f {$quagga_config_base}/ospfd.conf From f239745c91f67c7dcb9c2a6004e5707a0a4d0b75 Mon Sep 17 00:00:00 2001 From: doktornotor Date: Wed, 25 Jan 2017 11:23:21 +0100 Subject: [PATCH 2/4] Bump port version --- net/pfSense-pkg-Quagga_OSPF/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/pfSense-pkg-Quagga_OSPF/Makefile b/net/pfSense-pkg-Quagga_OSPF/Makefile index 57e4cd753623..71f5ac88e661 100644 --- a/net/pfSense-pkg-Quagga_OSPF/Makefile +++ b/net/pfSense-pkg-Quagga_OSPF/Makefile @@ -1,7 +1,7 @@ # $FreeBSD$ PORTNAME= pfSense-pkg-Quagga_OSPF -PORTVERSION= 0.6.16 +PORTVERSION= 0.6.17 CATEGORIES= net MASTER_SITES= # empty DISTFILES= # empty From e1a23cfe5761f90a1da4327d7232510a69e07ef3 Mon Sep 17 00:00:00 2001 From: doktornotor Date: Mon, 6 Feb 2017 10:56:25 +0100 Subject: [PATCH 3/4] Use pgrep/pkill, remove redundant comments --- .../files/usr/local/pkg/quagga_ospfd.inc | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/net/pfSense-pkg-Quagga_OSPF/files/usr/local/pkg/quagga_ospfd.inc b/net/pfSense-pkg-Quagga_OSPF/files/usr/local/pkg/quagga_ospfd.inc index 95ffd4c40958..f9dfe4891928 100644 --- a/net/pfSense-pkg-Quagga_OSPF/files/usr/local/pkg/quagga_ospfd.inc +++ b/net/pfSense-pkg-Quagga_OSPF/files/usr/local/pkg/quagga_ospfd.inc @@ -304,14 +304,12 @@ EOF; $rc_file_stop = <</dev/null -#/usr/bin/killall -9 ospfd 2>/dev/null sleep 1 -pidnum="$(/bin/pgrep zebra)" -if [ ! -z "\${pidnum}" ]; then +if /bin/pgrep -q zebra; then /usr/bin/killall zebra sleep 1 /usr/bin/killall -9 zebra 2>/dev/null fi -pidnum="$(/bin/pgrep ospfd)" -if [ ! -z "\${pidnum}" ]; then +if /bin/pgrep -q ospfd; then /usr/bin/killall ospfd sleep 1 /usr/bin/killall -9 ospfd 2>/dev/null From 1992835a02d793bcf46020ecfe29d48a5f736e61 Mon Sep 17 00:00:00 2001 From: doktornotor Date: Mon, 6 Feb 2017 11:12:12 +0100 Subject: [PATCH 4/4] Fix pkill usage --- .../files/usr/local/pkg/quagga_ospfd.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/pfSense-pkg-Quagga_OSPF/files/usr/local/pkg/quagga_ospfd.inc b/net/pfSense-pkg-Quagga_OSPF/files/usr/local/pkg/quagga_ospfd.inc index f9dfe4891928..67505872649c 100644 --- a/net/pfSense-pkg-Quagga_OSPF/files/usr/local/pkg/quagga_ospfd.inc +++ b/net/pfSense-pkg-Quagga_OSPF/files/usr/local/pkg/quagga_ospfd.inc @@ -304,12 +304,12 @@ EOF; $rc_file_stop = <<