5
This is very odd. I'm trying to set the ulimit
to 60000
via my startup.sh
:
#!/bin/bash
ulimit -n 60000
echo "Hello! File Descriptor set"
I can execute this with ./startup.sh
(755 file permissions) and the echo line is printed, and no errors are shown. However, when I do ulimit -n
it still shows 1024
, what's going on?
What I also find fascinating is I can type ulimit -n 60000
in the terminal, and then do ulimit -n
and it works perfectly. Why can't I set the file descriptor limit through a script?
Debian 8, 64-bit. OpenVZ Container
Awesome, thank you for the detailed explanation. Kept thinking it was a global setting or something. – John Miller – 2018-01-26T21:12:23.793
@John Normally the closest thing to a global setting would be
/proc/sys/fs/file-max
. Since you're inside a container, OpenVZ may also be applying various limits seen in/proc/user_beancounters
. – user1686 – 2018-01-26T21:16:09.720