From f7fd07d4881fd5f2eb878cf23b36b818aa5c2da7 Mon Sep 17 00:00:00 2001 From: Steven Foerster Date: Thu, 31 Dec 2020 11:33:40 -0500 Subject: [PATCH 1/5] partof --- scripts/services/Mistborn-bitwarden.service | 1 + scripts/services/Mistborn-homeassistant.service | 1 + scripts/services/Mistborn-jellyfin.service | 1 + scripts/services/Mistborn-jitsi.service | 1 + scripts/services/Mistborn-nextcloud.service | 1 + scripts/services/Mistborn-onlyoffice.service | 1 + scripts/services/Mistborn-rocketchat.service | 1 + scripts/services/Mistborn-syncthing.service | 1 + scripts/services/Mistborn-tor.service | 1 + 9 files changed, 9 insertions(+) diff --git a/scripts/services/Mistborn-bitwarden.service b/scripts/services/Mistborn-bitwarden.service index ff79fde..d1343da 100644 --- a/scripts/services/Mistborn-bitwarden.service +++ b/scripts/services/Mistborn-bitwarden.service @@ -2,6 +2,7 @@ Description=Mistborn Bitwarden Service Requires=Mistborn-base.service After=Mistborn-base.service +PartOf=Mistborn-base.service [Service] Restart=always diff --git a/scripts/services/Mistborn-homeassistant.service b/scripts/services/Mistborn-homeassistant.service index f1a0d4d..2acc9d8 100644 --- a/scripts/services/Mistborn-homeassistant.service +++ b/scripts/services/Mistborn-homeassistant.service @@ -2,6 +2,7 @@ Description=Mistborn Home Assistant Requires=Mistborn-base.service After=Mistborn-base.service +PartOf=Mistborn-base.service [Service] Restart=always diff --git a/scripts/services/Mistborn-jellyfin.service b/scripts/services/Mistborn-jellyfin.service index 86d1315..d41c5f3 100644 --- a/scripts/services/Mistborn-jellyfin.service +++ b/scripts/services/Mistborn-jellyfin.service @@ -2,6 +2,7 @@ Description=Mistborn Jellyfin Service Requires=Mistborn-nextcloud.service After=Mistborn-nextcloud.service +PartOf=Mistborn-base.service [Service] Restart=always diff --git a/scripts/services/Mistborn-jitsi.service b/scripts/services/Mistborn-jitsi.service index 49a9c21..c4c388f 100644 --- a/scripts/services/Mistborn-jitsi.service +++ b/scripts/services/Mistborn-jitsi.service @@ -2,6 +2,7 @@ Description=Mistborn Jitsi Service Requires=Mistborn-base.service After=Mistborn-base.service +PartOf=Mistborn-base.service [Service] Restart=always diff --git a/scripts/services/Mistborn-nextcloud.service b/scripts/services/Mistborn-nextcloud.service index 6a9302c..40ed97a 100644 --- a/scripts/services/Mistborn-nextcloud.service +++ b/scripts/services/Mistborn-nextcloud.service @@ -2,6 +2,7 @@ Description=Mistborn Nextcloud Service Requires=Mistborn-base.service After=Mistborn-base.service +PartOf=Mistborn-base.service [Service] Restart=always diff --git a/scripts/services/Mistborn-onlyoffice.service b/scripts/services/Mistborn-onlyoffice.service index 421912e..5e02128 100644 --- a/scripts/services/Mistborn-onlyoffice.service +++ b/scripts/services/Mistborn-onlyoffice.service @@ -2,6 +2,7 @@ Description=Mistborn OnlyOffice Service Requires=Mistborn-base.service After=Mistborn-base.service +PartOf=Mistborn-base.service [Service] Restart=always diff --git a/scripts/services/Mistborn-rocketchat.service b/scripts/services/Mistborn-rocketchat.service index ecb93a2..3c1379d 100644 --- a/scripts/services/Mistborn-rocketchat.service +++ b/scripts/services/Mistborn-rocketchat.service @@ -2,6 +2,7 @@ Description=Mistborn Rocket Chat Service Requires=Mistborn-base.service After=Mistborn-base.service +PartOf=Mistborn-base.service [Service] Restart=always diff --git a/scripts/services/Mistborn-syncthing.service b/scripts/services/Mistborn-syncthing.service index e3065f3..234a213 100644 --- a/scripts/services/Mistborn-syncthing.service +++ b/scripts/services/Mistborn-syncthing.service @@ -2,6 +2,7 @@ Description=Mistborn Syncthing Service Requires=Mistborn-base.service After=Mistborn-base.service +PartOf=Mistborn-base.service [Service] Restart=always diff --git a/scripts/services/Mistborn-tor.service b/scripts/services/Mistborn-tor.service index bbb871f..68d01c5 100644 --- a/scripts/services/Mistborn-tor.service +++ b/scripts/services/Mistborn-tor.service @@ -2,6 +2,7 @@ Description=Mistborn Tor Service Requires=Mistborn-base.service After=Mistborn-base.service +PartOf=Mistborn-base.service [Service] Restart=always From b4b0e69d4c2db19c9d05a3877d954d15efb10fb4 Mon Sep 17 00:00:00 2001 From: Steven Foerster Date: Thu, 31 Dec 2020 11:35:35 -0500 Subject: [PATCH 2/5] overcommit memory --- scripts/subinstallers/iptables.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/subinstallers/iptables.sh b/scripts/subinstallers/iptables.sh index a687eb1..e40cc33 100755 --- a/scripts/subinstallers/iptables.sh +++ b/scripts/subinstallers/iptables.sh @@ -113,6 +113,7 @@ fi # IP forwarding sudo sed -i 's/.*net.ipv4.ip_forward.*/net.ipv4.ip_forward=1/' /etc/sysctl.conf +sudo sed -i 's/.*vm.overcommit_memory.*/vm.overcommit_memory=1/' /etc/sysctl.conf sudo sysctl -p /etc/sysctl.conf # rsyslog to create /var/log/iptables.log From 90088bd5ceccae06ae51069bf53cf39592b3f4ae Mon Sep 17 00:00:00 2001 From: Steven Foerster Date: Thu, 31 Dec 2020 21:16:22 -0500 Subject: [PATCH 3/5] vm commit --- scripts/subinstallers/iptables.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/subinstallers/iptables.sh b/scripts/subinstallers/iptables.sh index e40cc33..7a80060 100755 --- a/scripts/subinstallers/iptables.sh +++ b/scripts/subinstallers/iptables.sh @@ -113,7 +113,8 @@ fi # IP forwarding sudo sed -i 's/.*net.ipv4.ip_forward.*/net.ipv4.ip_forward=1/' /etc/sysctl.conf -sudo sed -i 's/.*vm.overcommit_memory.*/vm.overcommit_memory=1/' /etc/sysctl.conf +sudo sed -i 's/.*vm.overcommit_memory.*/d' /etc/sysctl.conf +echo "vm.overcommit_memory=1" | sudo tee -a /etc/sysctl.conf sudo sysctl -p /etc/sysctl.conf # rsyslog to create /var/log/iptables.log From be5cf0d81222d5efedbcacc046e12f4bc8d3c904 Mon Sep 17 00:00:00 2001 From: Steven Foerster Date: Thu, 31 Dec 2020 21:25:31 -0500 Subject: [PATCH 4/5] better logic --- scripts/subinstallers/iptables.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/subinstallers/iptables.sh b/scripts/subinstallers/iptables.sh index 7a80060..7212043 100755 --- a/scripts/subinstallers/iptables.sh +++ b/scripts/subinstallers/iptables.sh @@ -113,8 +113,11 @@ fi # IP forwarding sudo sed -i 's/.*net.ipv4.ip_forward.*/net.ipv4.ip_forward=1/' /etc/sysctl.conf -sudo sed -i 's/.*vm.overcommit_memory.*/d' /etc/sysctl.conf -echo "vm.overcommit_memory=1" | sudo tee -a /etc/sysctl.conf + +# VM Overcommit Memory +grep -i "vm.overcommit_memory" /etc/sysctl.conf && sed -i 's/.*vm.overcommit_memory.*/vm.overcommit_memory=1/' /etc/sysctl.conf || echo "vm.overcommit_memory=1" | sudo tee -a /etc/sysctl.conf + +# Force re-read of sysctl.conf sudo sysctl -p /etc/sysctl.conf # rsyslog to create /var/log/iptables.log From 11413f47c7b0505e5bf798303a8a12bd67ffc170 Mon Sep 17 00:00:00 2001 From: Steven Foerster Date: Thu, 31 Dec 2020 21:41:14 -0500 Subject: [PATCH 5/5] sudo --- scripts/subinstallers/iptables.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/subinstallers/iptables.sh b/scripts/subinstallers/iptables.sh index 7212043..84aada7 100755 --- a/scripts/subinstallers/iptables.sh +++ b/scripts/subinstallers/iptables.sh @@ -115,7 +115,7 @@ fi sudo sed -i 's/.*net.ipv4.ip_forward.*/net.ipv4.ip_forward=1/' /etc/sysctl.conf # VM Overcommit Memory -grep -i "vm.overcommit_memory" /etc/sysctl.conf && sed -i 's/.*vm.overcommit_memory.*/vm.overcommit_memory=1/' /etc/sysctl.conf || echo "vm.overcommit_memory=1" | sudo tee -a /etc/sysctl.conf +sudo grep -i "vm.overcommit_memory" /etc/sysctl.conf && sudo sed -i 's/.*vm.overcommit_memory.*/vm.overcommit_memory=1/' /etc/sysctl.conf || echo "vm.overcommit_memory=1" | sudo tee -a /etc/sysctl.conf # Force re-read of sysctl.conf sudo sysctl -p /etc/sysctl.conf