Make our swap config compatible with systemd >= 207 (#331)

Make our swap config compatible with systemd >= 207 (#331)

From 874fa4d375aa139e1a442693654ac9f5abe158f9 Mon Sep 17 00:00:00 2001
From: Rafael dos Santos Silva <xfalcox@gmail.com>
Date: Tue, 27 Nov 2018 05:39:46 -0200
Subject: [PATCH] Make our swap config compatible with systemd >= 207 (#331)


diff --git a/discourse-setup b/discourse-setup
index 832fe70..c4f263b 100755
--- a/discourse-setup
+++ b/discourse-setup
@@ -144,7 +144,7 @@ check_disk_and_memory() {
       swapon /swapfile
       echo "/swapfile       swap    swap    auto      0       0" | tee -a /etc/fstab
       sysctl -w vm.swappiness=10
-      echo vm.swappiness = 10 | tee -a /etc/sysctl.conf
+      echo 'vm.swappiness = 10' > /etc/sysctl.d/30-discourse-swap.conf
 
       total_swap=`free -g --si | awk ' /Swap:/ {print $2} '`
       if [ "$total_swap" -lt 2 ]; then

GitHub

1 Like

@Falco do you think we should support non systemd for discourse setup?