From 9cc8fe77b4536223078e5cf49b501411008023e5 2018-11-08 13:11:51 From: Unknown Date: 2018-11-08 13:11:51 Subject: [PATCH] iptables fix iptables-legacy, iptables-legacy-save, iptables-legacy-restore set as default added 5s delay in firewall start. Fixing error "another app is currently holding the xtables lock" on boot --- diff --git a/bootstrap.d/21-firewall.sh b/bootstrap.d/21-firewall.sh index cf36c99..d5cd258 100644 --- a/bootstrap.d/21-firewall.sh +++ b/bootstrap.d/21-firewall.sh @@ -8,7 +8,12 @@ if [ "$ENABLE_IPTABLES" = true ] ; then # Create iptables configuration directory mkdir -p "${ETC_DIR}/iptables" - + + # make sure iptables-legacy,iptables-legacy-restore and iptables-legacy-save are the used alternatives + chroot_exec update-alternatives --verbose --set iptables /usr/bin/iptables-legacy + chroot_exec update-alternatives --verbose --set iptables-save /usr/bin/iptables-legacy-save + chroot_exec update-alternatives --verbose --set iptables-restore /usr/bin/iptables-legacy-restore + # Install iptables systemd service install_readonly files/iptables/iptables.service "${ETC_DIR}/systemd/system/iptables.service" diff --git a/files/iptables/ip6tables.service b/files/iptables/ip6tables.service index bb1644f..c5a5a90 100644 --- a/files/iptables/ip6tables.service +++ b/files/iptables/ip6tables.service @@ -6,7 +6,7 @@ Before=sysinit.target [Service] Type=oneshot -ExecStart=/sbin/ip6tables-restore /etc/iptables/ip6tables.rules +ExecStart=/sbin/ip6tables-restore -w 5 /etc/iptables/ip6tables.rules ExecReload=/sbin/ip6tables-restore /etc/iptables/ip6tables.rules ExecStop=/etc/iptables/flush-ip6tables.sh RemainAfterExit=yes diff --git a/files/iptables/iptables.service b/files/iptables/iptables.service index f5a1e89..0d234aa 100644 --- a/files/iptables/iptables.service +++ b/files/iptables/iptables.service @@ -6,7 +6,7 @@ Before=sysinit.target [Service] Type=oneshot -ExecStart=/sbin/iptables-restore /etc/iptables/iptables.rules +ExecStart=/sbin/iptables-restore -w 5 /etc/iptables/iptables.rules ExecReload=/sbin/iptables-restore /etc/iptables/iptables.rules ExecStop=/etc/iptables/flush-iptables.sh RemainAfterExit=yes