This is an automated email from the ASF dual-hosted git repository.

joao pushed a commit to branch 4.18
in repository https://gitbox.apache.org/repos/asf/cloudstack.git


The following commit(s) were added to refs/heads/4.18 by this push:
     new 8c62365dbb1 VPC VR: fix empty iptables if there is no vpc tier (#8787)
8c62365dbb1 is described below

commit 8c62365dbb140feb8ab350724b4567f5ed449454
Author: Wei Zhou <weiz...@apache.org>
AuthorDate: Tue Mar 19 18:45:24 2024 +0100

    VPC VR: fix empty iptables if there is no vpc tier (#8787)
---
 systemvm/debian/opt/cloud/bin/setup/postinit.sh | 26 ++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/systemvm/debian/opt/cloud/bin/setup/postinit.sh 
b/systemvm/debian/opt/cloud/bin/setup/postinit.sh
index ba5c394d9f2..6bb3f6bd097 100755
--- a/systemvm/debian/opt/cloud/bin/setup/postinit.sh
+++ b/systemvm/debian/opt/cloud/bin/setup/postinit.sh
@@ -26,6 +26,19 @@ log_it() {
 # Restart journald for setting changes to apply
 systemctl restart systemd-journald
 
+# Restore the persistent iptables nat, rules and filters for IPv4 and IPv6 if 
they exist
+ipv4="/etc/iptables/rules.v4"
+if [ -e $ipv4 ]
+then
+  iptables-restore < $ipv4
+fi
+
+ipv6="/etc/iptables/rules.v6"
+if [ -e $ipv6 ]
+then
+  ip6tables-restore < $ipv6
+fi
+
 CMDLINE=/var/cache/cloud/cmdline
 TYPE=$(grep -Po 'type=\K[a-zA-Z]*' $CMDLINE)
 if [ "$TYPE" == "router" ] || [ "$TYPE" == "vpcrouter" ] || [ "$TYPE" == 
"dhcpsrvr" ]
@@ -52,17 +65,4 @@ do
   systemctl disable --now --no-block $svc
 done
 
-# Restore the persistent iptables nat, rules and filters for IPv4 and IPv6 if 
they exist
-ipv4="/etc/iptables/rules.v4"
-if [ -e $ipv4 ]
-then
-  iptables-restore < $ipv4
-fi
-
-ipv6="/etc/iptables/rules.v6"
-if [ -e $ipv6 ]
-then
-  ip6tables-restore < $ipv6
-fi
-
 date > /var/cache/cloud/boot_up_done

Reply via email to