From ced66cda7dc4ed23e226f9518e9238c361a1bdc1 Mon Sep 17 00:00:00 2001 From: MoeClub <32381827+MoeClub@users.noreply.github.com> Date: Wed, 11 May 2022 17:57:05 +0800 Subject: [PATCH] Update LinuxInit.sh --- LinuxInit.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/LinuxInit.sh b/LinuxInit.sh index 44cf90b1..aa91918c 100644 --- a/LinuxInit.sh +++ b/LinuxInit.sh @@ -12,6 +12,9 @@ if [ -f /etc/security/limits.conf ]; then sed -i '/^\(\*\|root\)[[:space:]]*\(hard\|soft\)[[:space:]]*\(nofile\|memlock\)/d' /etc/security/limits.conf echo -ne "*\thard\tmemlock\t${LIMIT}\n*\tsoft\tmemlock\t${LIMIT}\nroot\thard\tmemlock\t${LIMIT}\nroot\tsoft\tmemlock\t${LIMIT}\n*\thard\tnofile\t${LIMIT}\n*\tsoft\tnofile\t${LIMIT}\nroot\thard\tnofile\t${LIMIT}\nroot\tsoft\tnofile\t${LIMIT}\n\n" >>/etc/security/limits.conf fi +if [ -f /etc/systemd/system.conf ]; then + sed -i 's/#\?DefaultLimitNOFILE=.*/DefaultLimitNOFILE=262144/' /etc/systemd/system.conf +fi # timezone ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo "Asia/Shanghai" >/etc/timezone