From 128c32d6a237e45c08ae8d1a154d179269366ed2 Mon Sep 17 00:00:00 2001 From: Sam Kumar Date: Thu, 15 Jul 2021 23:40:34 -0700 Subject: [PATCH] Avoid manual reboot for network parameters to take effect --- scripts/install_deps.sh | 3 +++ scripts/provision.sh | 2 ++ 2 files changed, 5 insertions(+) diff --git a/scripts/install_deps.sh b/scripts/install_deps.sh index e539af3..e62243b 100755 --- a/scripts/install_deps.sh +++ b/scripts/install_deps.sh @@ -59,6 +59,9 @@ do echo "net.ipv4.tcp_keepalive_time = 240" | sudo tee -a /etc/sysctl.conf echo "net.ipv4.tcp_keepalive_intvl = 65" | sudo tee -a /etc/sysctl.conf echo "net.ipv4.tcp_keepalive_probes = 5" | sudo tee -a /etc/sysctl.conf + + # Reload /etc/sysctl.conf (so you don't have to reboot to effect the above changes) + sudo sysctl -p /etc/sysctl.conf ;; *) echo "Unknown command-line flag" $flag diff --git a/scripts/provision.sh b/scripts/provision.sh index 4561a1e..2015f33 100755 --- a/scripts/provision.sh +++ b/scripts/provision.sh @@ -56,6 +56,8 @@ fi mkdir -p ~/work sudo mount ${DISK_DEVICE} ~/work sudo chown $(whoami):$(whoami) ~/work +# If not using a pre-installed image, this line will fail, as /opt won't exist. +# It doesn't harm anything, so I didn't bother wrapping it in the appropriate "if" statement. cp -r /opt/* ~/work mkdir -p ~/work/scratch