From d3f6cf61de9e6fec8210dcaed2cb8f4c4fd89580 Mon Sep 17 00:00:00 2001 From: Wei Zhou Date: Wed, 4 Sep 2024 11:36:38 +0000 Subject: [PATCH] sharedfsvm: update /etc/hosts at first --- systemvm/debian/opt/cloud/bin/setup/sharedfsvm.sh | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/systemvm/debian/opt/cloud/bin/setup/sharedfsvm.sh b/systemvm/debian/opt/cloud/bin/setup/sharedfsvm.sh index b0976edfdaf1..4908f8c1eec0 100644 --- a/systemvm/debian/opt/cloud/bin/setup/sharedfsvm.sh +++ b/systemvm/debian/opt/cloud/bin/setup/sharedfsvm.sh @@ -26,21 +26,19 @@ setup_sharedfsvm() { update-alternatives --set arptables /usr/sbin/arptables-legacy update-alternatives --set ebtables /usr/sbin/ebtables-legacy + log_it "Setting up entry in hosts" + sed -i /$NAME/d /etc/hosts + echo "$ETH0_IP $NAME" >> /etc/hosts + # set default ssh port and restart sshd service sed -i 's/3922/22/g' /etc/ssh/sshd_config systemctl restart ssh - sed -i '/- ssh$/s/- ssh/- [ssh, always]/' /etc/cloud/cloud.cfg - > /root/.ssh/authorized_keys swapoff -a sudo sed -i '/ swap / s/^/#/' /etc/fstab log_it "Swap disabled" - log_it "Setting up entry in hosts" - sed -i /$NAME/d /etc/hosts - echo "$ETH0_IP $NAME" >> /etc/hosts - echo "export PATH='$PATH:/opt/bin/'">> ~/.bashrc disable_rpfilter