From 29f4fd503510617369663d5af2276dd4689bd89b Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Mon, 19 May 2014 10:41:52 +1000 Subject: [PATCH 1/1] Fix error message when swap is disabled Bug: 65465 Change-Id: Ibb1b14f5271d60c039398e8ce8a9c2a5d245241f --- includes/limit.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/includes/limit.sh b/includes/limit.sh index 82197b53ca..d71e660387 100644 --- a/includes/limit.sh +++ b/includes/limit.sh @@ -76,7 +76,10 @@ if [ "$MW_MEM_LIMIT" -gt 0 ]; then # Memory echo $(($MW_MEM_LIMIT*1024)) > "$MW_CGROUP"/$$/memory.limit_in_bytes # Memory+swap - echo $(($MW_MEM_LIMIT*1024)) > "$MW_CGROUP"/$$/memory.memsw.limit_in_bytes + # This will be missing if there is no swap + if [ -e "$MW_CGROUP"/$$/memory.memsw.limit_in_bytes ]; then + echo $(($MW_MEM_LIMIT*1024)) > "$MW_CGROUP"/$$/memory.memsw.limit_in_bytes + fi else ulimit -v "$MW_MEM_LIMIT" fi -- 2.20.1