From 37d1f05a850fd066d1998375e1d018e70c68de75 Mon Sep 17 00:00:00 2001 From: rootzoll Date: Sun, 19 Dec 2021 16:40:08 +0100 Subject: [PATCH] double PAM file open limit --- build_sdcard.sh | 8 ++++---- home.admin/config.scripts/blitz.datadrive.sh | 10 ++++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/build_sdcard.sh b/build_sdcard.sh index 0d37336d4..58e43d106 100755 --- a/build_sdcard.sh +++ b/build_sdcard.sh @@ -530,10 +530,10 @@ sudo dphys-swapfile uninstall echo -e "\n*** INCREASE OPEN FILE LIMIT ***" # based on https://stadicus.github.io/RaspiBolt/raspibolt_21_security.html#increase-your-open-files-limit -sudo sed --in-place -i "56s/.*/* soft nofile 128000/" /etc/security/limits.conf -sudo bash -c "echo '* hard nofile 128000' >> /etc/security/limits.conf" -sudo bash -c "echo 'root soft nofile 128000' >> /etc/security/limits.conf" -sudo bash -c "echo 'root hard nofile 128000' >> /etc/security/limits.conf" +sudo sed --in-place -i "56s/.*/* soft nofile 256000/" /etc/security/limits.conf +sudo bash -c "echo '* hard nofile 256000' >> /etc/security/limits.conf" +sudo bash -c "echo 'root soft nofile 256000' >> /etc/security/limits.conf" +sudo bash -c "echo 'root hard nofile 256000' >> /etc/security/limits.conf" sudo bash -c "echo '# End of file' >> /etc/security/limits.conf" sudo sed --in-place -i "23s/.*/session required pam_limits.so/" /etc/pam.d/common-session sudo sed --in-place -i "25s/.*/session required pam_limits.so/" /etc/pam.d/common-session-noninteractive diff --git a/home.admin/config.scripts/blitz.datadrive.sh b/home.admin/config.scripts/blitz.datadrive.sh index 6afb49c21..dc50d9a93 100755 --- a/home.admin/config.scripts/blitz.datadrive.sh +++ b/home.admin/config.scripts/blitz.datadrive.sh @@ -1492,14 +1492,16 @@ if [ "$1" = "swap" ]; then if [ ${isBTRFS} -eq 1 ]; then >&2 echo "# Rewrite external SWAP config for BTRFS setup" - sudo sed -i "12s/.*/CONF_SWAPFILE=\/mnt\/temp\/swapfile/" /etc/dphys-swapfile - sudo sed -i "16s/.*/#CONF_SWAPSIZE=/" /etc/dphys-swapfile + sudo sed -i "s/^#CONF_SWAPFILE=/CONF_SWAPFILE=/g" /etc/dphys-swapfile + sudo sed -i "s/^CONF_SWAPFILE=.*/CONF_SWAPFILE=\/mnt\/temp\/swapfile/g" /etc/dphys-swapfile + sudo sed -i "s/^CONF_SWAPSIZE=/#CONF_SWAPSIZE=/g" /etc/dphys-swapfile else >&2 echo "# Rewrite external SWAP config for EXT4 setup" - sudo sed -i "12s/.*/CONF_SWAPFILE=\/mnt\/hdd\/swapfile/" /etc/dphys-swapfile - sudo sed -i "16s/.*/#CONF_SWAPSIZE=/" /etc/dphys-swapfile + sudo sed -i "s/^#CONF_SWAPFILE=/CONF_SWAPFILE=/g" /etc/dphys-swapfile + sudo sed -i "s/^CONF_SWAPFILE=.*/CONF_SWAPFILE=\/mnt\/hdd\/swapfile/g" /etc/dphys-swapfile + sudo sed -i "s/^CONF_SWAPSIZE=/#CONF_SWAPSIZE=/g" /etc/dphys-swapfile fi