]> git.ipfire.org Git - ipfire-3.x.git/commitdiff
setup: Configure swappiness
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 16 Nov 2016 21:37:46 +0000 (21:37 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 16 Nov 2016 21:37:46 +0000 (21:37 +0000)
This will turn off any preemptive swapping and will only allow
swapping to avoid any OOM conditions. This will help to keep
the system responsive, avoids latency and saves writing on
storage.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
setup/setup.nm
setup/sysctl/swappiness.conf [new file with mode: 0644]

index 61d3ba60335f77f870397403d0082c0968dbf67d..75c9da22fd5ad2e9743dac697746418a75af4e8d 100644 (file)
@@ -5,7 +5,7 @@
 
 name       = setup
 version    = 3.0
-release    = 7
+release    = 8
 arch       = noarch
 
 groups     = Base Build System/Base
@@ -45,8 +45,12 @@ build
                        cp -vf %{DIR_APP}/${i} %{BUILDROOT}/etc || exit 1; \
                done
 
-               touch %{BUILDROOT}/etc/{environment,fstab}
-               chmod -v 0400 %{BUILDROOT}/etc/{,g}shadow
+               touch %{BUILDROOT}%{sysconfdir}/{environment,fstab}
+               chmod -v 0400 %{BUILDROOT}%{sysconfdir}/{,g}shadow
+
+               mkdir -pv %{BUILDROOT}%{sysconfdir}/sysctl.d
+               install -m 644 %{DIR_APP}/sysctl/swappiness.conf \
+                       %{BUILDROOT}%{sysconfdir}/sysctl.d/swappiness.conf
        end
 end
 
diff --git a/setup/sysctl/swappiness.conf b/setup/sysctl/swappiness.conf
new file mode 100644 (file)
index 0000000..253b75c
--- /dev/null
@@ -0,0 +1,5 @@
+# This will turn off any preemptive swapping and will only allow swapping to
+# avoid any OOM conditions. This will help to keep the system responsive,
+# avoids latency and saves writing on storage.
+
+vm.swappiness = 0