Commit c716fd27 authored by Joshua Tauberer's avatar Joshua Tauberer

refuse to start if the system has less than 768 MB of RAM, except when testing within Vagrant

parent 4e5b5f28
...@@ -16,6 +16,7 @@ fi ...@@ -16,6 +16,7 @@ fi
# Check system setup. # Check system setup.
# Check that we are running on Ubuntu 14.04 LTS.
if [ "`lsb_release -d | sed 's/.*:\s*//'`" != "Ubuntu 14.04 LTS" ]; then if [ "`lsb_release -d | sed 's/.*:\s*//'`" != "Ubuntu 14.04 LTS" ]; then
echo echo
echo "Mail-in-a-Box only supports being installed on Ubuntu 14.04, sorry. You are running:" echo "Mail-in-a-Box only supports being installed on Ubuntu 14.04, sorry. You are running:"
...@@ -26,6 +27,18 @@ if [ "`lsb_release -d | sed 's/.*:\s*//'`" != "Ubuntu 14.04 LTS" ]; then ...@@ -26,6 +27,18 @@ if [ "`lsb_release -d | sed 's/.*:\s*//'`" != "Ubuntu 14.04 LTS" ]; then
exit exit
fi fi
# Check that we have enough memory. Skip the check if we appear to be
# running inside of Vagrant, because that's really just for testing.
TOTAL_PHYSICAL_MEM=$(free -m | grep ^Mem: | sed "s/^Mem: *\([0-9]*\).*/\1/")
if [ $TOTAL_PHYSICAL_MEM -lt 768 ]; then
if [ ! -d /vagrant ]; then
echo
echo "Your Mail-in-a-Box needs more than $TOTAL_PHYSICAL_MEM MB RAM."
echo "Please provision a machine with at least 768 MB, 1 GB recommended."
exit
fi
fi
# Recall the last settings used if we're running this a second time. # Recall the last settings used if we're running this a second time.
if [ -f /etc/mailinabox.conf ]; then if [ -f /etc/mailinabox.conf ]; then
# Run any system migrations before proceeding. Since this is a second run, # Run any system migrations before proceeding. Since this is a second run,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment