From 9c6677d2fd23a74027fe86ed0072035a2e5b599b Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Wed, 27 Mar 2019 10:32:39 -0400 Subject: [PATCH] TT#56007 TT#55864 leave xt_RTPENGINE loaded after stop There might be a firewall script that installs and manages the xt_RTPENGINE rules even if rtpengine isn't running at the point. Leave the module loaded if possible and unload it only for a package removal or upgrade. Change-Id: I5a35e965379aebd757a45883f82bbcb5fa2412e8 --- debian/ngcp-rtpengine-iptables-setup | 1 - debian/ngcp-rtpengine-kernel-dkms.prerm | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/debian/ngcp-rtpengine-iptables-setup b/debian/ngcp-rtpengine-iptables-setup index 252939cb3..e4d537a09 100755 --- a/debian/ngcp-rtpengine-iptables-setup +++ b/debian/ngcp-rtpengine-iptables-setup @@ -81,7 +81,6 @@ firewall_teardown() iptables -D rtpengine -p udp -j RTPENGINE --id "$TABLE" 2>/dev/null ip6tables -D rtpengine -p udp -j RTPENGINE --id "$TABLE" 2>/dev/null - rmmod $MODNAME 2>/dev/null } case "$1" in diff --git a/debian/ngcp-rtpengine-kernel-dkms.prerm b/debian/ngcp-rtpengine-kernel-dkms.prerm index e58a7f13a..be28c80db 100644 --- a/debian/ngcp-rtpengine-kernel-dkms.prerm +++ b/debian/ngcp-rtpengine-kernel-dkms.prerm @@ -4,6 +4,7 @@ set -e package=ngcp-rtpengine-kernel-dkms name=ngcp-rtpengine +modname=xt_RTPENGINE version=$(dpkg-query -W -f="\${Version}" "$package" \ |rev|cut -d- -f2-|rev|cut -d':' -f2|tr -d "\n") @@ -17,6 +18,7 @@ fi # make sure it's not running if [ -x /etc/init.d/ngcp-rtpengine-daemon ] ; then invoke-rc.d ngcp-rtpengine-daemon stop || true + rmmod "$modname" 2>/dev/null || true fi if [ "$VIRT" = "yes" ]; then