Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quagga_OSPF - Attempt to work around Bug #6305 #265

Merged
merged 4 commits into from
Feb 7, 2017
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion net/pfSense-pkg-Quagga_OSPF/Makefile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
18 changes: 14 additions & 4 deletions net/pfSense-pkg-Quagga_OSPF/files/usr/local/pkg/quagga_ospfd.inc
Original file line number Diff line number Diff line change
Expand Up @@ -303,11 +303,13 @@ EOF;
// Create rc.d file
$rc_file_stop = <<<EOF
if [ -e /var/run/quagga/zebra.pid ]; then
/bin/kill -9 `/bin/cat /var/run/quagga/zebra.pid`
# XXX: See Bug #6305 - Quagga 1.x does not like SIGKILL
/bin/pkill -F `/bin/cat /var/run/quagga/zebra.pid`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-F parameter expects a path for pidfile, no need to cat here

/bin/rm -f /var/run/quagga/zebra.pid
fi
if [ -e /var/run/quagga/ospfd.pid ]; then
/bin/kill -9 `/bin/cat /var/run/quagga/ospfd.pid`
# XXX: See Bug #6305 - Quagga 1.x does not like SIGKILL
/bin/pkill -F `/bin/cat /var/run/quagga/ospfd.pid`
/bin/rm -f /var/run/quagga/ospfd.pid
fi
EOF;
Expand All @@ -321,9 +323,17 @@ EOF;
/usr/sbin/chown -R quagga:quagga /var/run/quagga
/usr/sbin/chown -R quagga:quagga /var/log/quagga
# Ensure no other copies of the daemons are running or it breaks.
/usr/bin/killall -9 zebra 2>/dev/null
/usr/bin/killall -9 ospfd 2>/dev/null
sleep 1
if /bin/pgrep -q zebra; then
/usr/bin/killall zebra
sleep 1
/usr/bin/killall -9 zebra 2>/dev/null
fi
if /bin/pgrep -q ospfd; then
/usr/bin/killall ospfd
sleep 1
/usr/bin/killall -9 ospfd 2>/dev/null
fi
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use pgrep to detect if process is running

if pgrep -q zebra; then
    pkill zebra
    ...
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
Expand Down