Only check resources on bootstrap / rebuild
authorMatt Palmer <mpalmer@hezmatt.org>
Mon, 21 Sep 2015 03:47:48 +0000 (13:47 +1000)
committerMatt Palmer <mpalmer@hezmatt.org>
Fri, 30 Oct 2015 20:10:42 +0000 (07:10 +1100)
There's no reason to make sure there's enough diskspace or memory unless
we're building a container.

launcher

index db203c383119d7f092ee2ab8bd989ca2fd217d72..9038f8ff002dfb802d14e33e28addd06f38e6fa6 100755 (executable)
--- a/launcher
+++ b/launcher
@@ -152,9 +152,10 @@ prereqs() {
     exit 1
   fi
 
-  # 6. sufficient available resources
-  # 6a. Memory
-  #
+}
+
+check_resources() {
+  # Memory
   resources="ok"
   avail_mem="$(LANG=C free -m | grep '^Mem:' | awk '{print $2}')"
   if [ "$avail_mem" -lt 900 ]; then
@@ -179,7 +180,7 @@ prereqs() {
     fi
   fi
 
-  # 6b. Disk space
+  # Disk space
   free_disk="$(df /var | tail -n 1 | awk '{print $4}')"
   if [ "$free_disk" -lt 5000 ]; then
     resources="insufficient"
@@ -465,6 +466,8 @@ run_start(){
 
 run_bootstrap(){
 
+  check_resources
+
   host_run
 
   get_ssh_pub_key