From e9677ae68dfe0d089b3b82307e2ed4bac09a0169 Mon Sep 17 00:00:00 2001 From: Michael Kroes Date: Mon, 14 Mar 2016 11:40:54 +0100 Subject: [PATCH] Use tools/editconf.py to manipulate sysctl.conf --- setup/system.sh | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/setup/system.sh b/setup/system.sh index 87b0342f..b6942496 100755 --- a/setup/system.sh +++ b/setup/system.sh @@ -33,19 +33,13 @@ if [ ! -e /swapfile ]; then echo "/swapfile none swap sw 0 0" >> /etc/fstab # Make sure the system only swaps as a last resort - SWAPPINESS=$(grep vm.swappiness /etc/sysctl.conf) - if [ -z "$SWAPPINESS" ]; then - hide_output sysctl vm.swappiness=10 - echo "vm.swappiness=10" >> /etc/sysctl.conf - fi + hide_output sysctl vm.swappiness=10 + tools/editconf.py /etc/sysctl.conf vm.swappiness=10 # Make sure the systeem keeps the file system inodes in # memory as long as possible - PRESSURE=$(grep vm.vfs_cache_pressure /etc/sysctl.conf) - if [ -z "$PRESSURE" ]; then - hide_output sysctl vm.vfs_cache_pressure=50 - echo "vm.vfs_cache_pressure=50" >> /etc/sysctl.conf - fi + hide_output sysctl vm.vfs_cache_pressure=50 + tools/editconf.py /etc/sysctl.conf vm.vfs_cache_pressure=50 fi fi fi