The officially official Devuan Forum!

You are not logged in.

#1 2025-04-16 18:31:17

Xellcom3000
Member
Registered: 2025-04-16
Posts: 1  

Unable to set the value “nofile” in /etc/security/limits.conf

Hello guys, I am having a problem getting the system to allow me to change this value. Every time I type the command ulimit -Hn in the terminal it shows me 4096, and I modified the file /etc/security/limits.conf adding this line: username hard nofile 524288, but nothing happens, every time I reboot the PC and type the command ulimit -Hn in the terminal the value stays at 4096, I also added this line: session required pam_limits.so in these two files: /etc/pam.d/common-session and /etc/pam.d/common-session-noninteractive, what should I do in this situation?

Last edited by Xellcom3000 (2025-04-16 20:33:02)

Offline

#2 2025-04-30 08:53:48

IdeaFix
Member
Registered: 2020-01-02
Posts: 31  
Website

Re: Unable to set the value “nofile” in /etc/security/limits.conf

I asked same question about tomcat. I will try to post here what I see in same situation:

All settings seems to be good and in the right places:

root@host:~# cat /etc/sysctl.conf | grep file-max
fs.file-max = 65535
root@host:~# cat /etc/security/limits.d/nofile.conf
tomcat hard nofile 65535
tomcat soft nofile 65535

Tomcat user shows right values:

root@host:~# sudo su -l tomcat -s /bin/bash
tomcat@host:~$ ulimit -n
65535
tomcat@host:~$ ulimit -Hn
65535
tomcat@host:~$ ulimit -Sn
65535

Looking for tomcat pids:

root@host:~# lsof -t -i:8080
10832
10893
12255
12304
12339
12383
12578

Checking limits, and found 8192 but not 65536:

root@host:~# cat /proc/12578/limits
Limit                     Soft Limit           Hard Limit           Units
Max cpu time              unlimited            unlimited            seconds
Max file size             unlimited            unlimited            bytes
Max data size             unlimited            unlimited            bytes
Max stack size            8388608              unlimited            bytes
Max core file size        0                    unlimited            bytes
Max resident set          unlimited            unlimited            bytes
Max processes             192572               192572               processes
Max open files            8192                 8192                 files
Max locked memory         65536                65536                bytes
Max address space         unlimited            unlimited            bytes
Max file locks            unlimited            unlimited            locks
Max pending signals       192572               192572               signals
Max msgqueue size         819200               819200               bytes
Max nice priority         0                    0
Max realtime priority     0                    0
Max realtime timeout      unlimited            unlimited            us
root@host:~# cat /proc/12383/limits
Limit                     Soft Limit           Hard Limit           Units
Max cpu time              unlimited            unlimited            seconds
Max file size             unlimited            unlimited            bytes
Max data size             unlimited            unlimited            bytes
Max stack size            8388608              unlimited            bytes
Max core file size        0                    unlimited            bytes
Max resident set          unlimited            unlimited            bytes
Max processes             192572               192572               processes
Max open files            8192                 8192                 files
Max locked memory         65536                65536                bytes
Max address space         unlimited            unlimited            bytes
Max file locks            unlimited            unlimited            locks
Max pending signals       192572               192572               signals
Max msgqueue size         819200               819200               bytes
Max nice priority         0                    0
Max realtime priority     0                    0
Max realtime timeout      unlimited            unlimited            us

Offline

Board footer