From fd6226187a59b1b5783fd9db82a96cab79420301 Mon Sep 17 00:00:00 2001 From: Michael Kroes Date: Sat, 15 Oct 2016 21:41:25 +0200 Subject: [PATCH] lower memory requirements to 512MB, display a warning if system memory is below 768MB. (#952) --- CHANGELOG.md | 4 ++++ setup/preflight.sh | 14 ++++++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1dccf38c..504e58b7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,10 @@ Control panel: * Status checks failed if the system doesn't support iptables * Add support for SSHFP records when sshd listens on non-standard ports +System: + +* Lower memory requirements to 512MB, display a warning if system memory is below 768MB. + v0.20 (September 23, 2016) -------------------------- diff --git a/setup/preflight.sh b/setup/preflight.sh index 4f73fffc..4be2ec41 100644 --- a/setup/preflight.sh +++ b/setup/preflight.sh @@ -19,20 +19,26 @@ fi # Check that we have enough memory. # -# /proc/meminfo reports free memory in kibibytes. Our baseline will be 768 MB, -# which is 750000 kibibytes. +# /proc/meminfo reports free memory in kibibytes. Our baseline will be 512 MB, +# which is 500000 kibibytes. +# +# We will display a warning if the memory is below 768 MB which is 750000 kibibytes # # Skip the check if we appear to be running inside of Vagrant, because that's really just for testing. TOTAL_PHYSICAL_MEM=$(head -n 1 /proc/meminfo | awk '{print $2}') -if [ $TOTAL_PHYSICAL_MEM -lt 750000 ]; then +if [ $TOTAL_PHYSICAL_MEM -lt 500000 ]; then if [ ! -d /vagrant ]; then TOTAL_PHYSICAL_MEM=$(expr \( \( $TOTAL_PHYSICAL_MEM \* 1024 \) / 1000 \) / 1000) echo "Your Mail-in-a-Box needs more memory (RAM) to function properly." - echo "Please provision a machine with at least 768 MB, 1 GB recommended." + echo "Please provision a machine with at least 512 MB, 1 GB recommended." echo "This machine has $TOTAL_PHYSICAL_MEM MB memory." exit fi fi +if [ $TOTAL_PHYSICAL_MEM -lt 750000 ]; then + echo "WARNING: Your Mail-in-a-Box has less than 768 MB of memory." + echo " It might run unreliably when under heavy load." +fi # Check that tempfs is mounted with exec MOUNTED_TMP_AS_NO_EXEC=$(grep "/tmp.*noexec" /proc/mounts)