From 4d68d061545952144ba8c88e154af3b3901ed12f Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Thu, 10 Jul 2025 10:43:19 -0600 Subject: [PATCH] Fix setting both hard and soft limits --- docker/main/rootfs/usr/local/ulimit/set_ulimit.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker/main/rootfs/usr/local/ulimit/set_ulimit.sh b/docker/main/rootfs/usr/local/ulimit/set_ulimit.sh index 6c1bacfa2..8dcf51ca1 100755 --- a/docker/main/rootfs/usr/local/ulimit/set_ulimit.sh +++ b/docker/main/rootfs/usr/local/ulimit/set_ulimit.sh @@ -14,7 +14,7 @@ TARGET_HARD_LIMIT=65536 if [ "$current_soft_limit" -lt "$TARGET_SOFT_LIMIT" ]; then # Attempt to set both soft and hard limits to the new value # This requires sufficient privileges (e.g., running as root in the container) - if ulimit -n "$TARGET_SOFT_LIMIT:$TARGET_HARD_LIMIT"; then + if ulimit -Hn "$TARGET_HARD" && ulimit -Sn "$TARGET_SOFT"; then new_soft_limit=$(ulimit -Sn) new_hard_limit=$(ulimit -Hn) @@ -22,6 +22,6 @@ if [ "$current_soft_limit" -lt "$TARGET_SOFT_LIMIT" ]; then echo "Warning: Limits were set, but not to the exact target values. Check system constraints." fi else - echo "Error: Failed to set new nofile limits." + echo "Warning: Failed to set new nofile limits." fi fi \ No newline at end of file