From 17070cf96c135e930919c4bff9222ff10956dcdb Mon Sep 17 00:00:00 2001 From: Hanqing Wu Date: Fri, 4 Aug 2023 16:19:23 +0800 Subject: [PATCH] nebd: set nofile soft limit to hard limit Signed-off-by: Hanqing Wu --- nebd/nebd-package/usr/bin/nebd-daemon | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/nebd/nebd-package/usr/bin/nebd-daemon b/nebd/nebd-package/usr/bin/nebd-daemon index 51dabbcf1d..fb8242d1dc 100755 --- a/nebd/nebd-package/usr/bin/nebd-daemon +++ b/nebd/nebd-package/usr/bin/nebd-daemon @@ -15,6 +15,11 @@ STARTED_AS_ROOT=false USERS_FILE=/etc/nebd/users USERS=() +# set nofile soft limit to hard limit +# we found that soft limit of nebd-daemon and nebd-server are 1024 after system reboot +# even /etc/security/limits.conf already set nofile limit to large number +ulimit -Sn $(ulimit -Hn) + if [[ $(id -u) -eq 0 ]]; then STARTED_AS_ROOT=true fi