From d2a481a204e619b8a47ceed11a87173cc4de892c Mon Sep 17 00:00:00 2001 From: Mohit Mehta Date: Mon, 18 Apr 2011 18:14:33 -0700 Subject: * Fix Bug 6915 conntrack-hash-size reverts to default after upgrade add script conntrack-hash-size in check-params-on-reboot.d to fix problem of 'firewall conntrack-hash-size' value being out-of-sync with the underlying value when newly installed image boots for the first time --- scripts/check-params-on-reboot.d/conntrack-hash-size | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 scripts/check-params-on-reboot.d/conntrack-hash-size (limited to 'scripts/check-params-on-reboot.d/conntrack-hash-size') diff --git a/scripts/check-params-on-reboot.d/conntrack-hash-size b/scripts/check-params-on-reboot.d/conntrack-hash-size new file mode 100755 index 0000000..6b3ba83 --- /dev/null +++ b/scripts/check-params-on-reboot.d/conntrack-hash-size @@ -0,0 +1,20 @@ +#!/bin/sh +# +# fix conntrack-hash-size on reboot +# + +BOOTFILE=$1 +cthash_cfg=$(cli-shell-api cfReturnValue $BOOTFILE firewall conntrack-hash-size) + +if [ -z "$cthash_cfg" ]; then + cthash_cfg=4096 # default hashsize value that Vyatta ships +fi + +if ! grep -q "nf_conntrack hashsize=$cthash_cfg$" \ + /etc/modprobe.d/vyatta_nf_conntrack.conf +then + sudo sh -c "sed -i -e '/options nf_conntrack hashsize/d' \ + /etc/modprobe.d/vyatta_nf_conntrack.conf" + sudo sh -c "echo options nf_conntrack hashsize=$cthash_cfg >> \ + /etc/modprobe.d/vyatta_nf_conntrack.conf" +fi -- cgit v1.2.3