/etc/security/limits.conf for setting program limits in Linux

Posted by Flavius Akerele on Super User See other posts from Super User or by Flavius Akerele
Published on 2011-02-09T13:09:11Z Indexed on 2011/02/09 15:27 UTC
Read the original article Hit count: 377

Filed under:
|
|

I have the following inside /etc/security/limits.conf (I have specified root separately because * will not include it.)

user2      -     core          unlimited
*          -     core          0
root       -     core          0
*          -     rss           512000
root       -     rss           512000
*          -     nproc         100
root       -     nproc         100
*          -     maxlogins     1
root       -     maxlogins     1

I run a program as user2 (./programname) but /proc/3498/limits says cores are disabled:

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                    0                    bytes     
Max resident set          524288000            524288000            bytes     
Max processes             100                  100                  processes 
Max open files            1024                 1024                 files     
Max locked memory         65536                65536                bytes     
Max address space         unlimited            unlimited            bytes     
Max file locks            unlimited            unlimited            locks     
Max pending signals       14001                14001                signals   
Max msgqueue size         819200               819200               bytes     
Max nice priority         0                    0                    
Max realtime priority     0                    0                    
Max realtime timeout      unlimited            unlimited            us

Both ulimit -Sa and ulimit -Ha output that cores are disabled:

core file size          (blocks, -c) 0
data seg size           (kbytes, -d) unlimited
scheduling priority             (-e) 0
file size               (blocks, -f) unlimited
pending signals                 (-i) 14001
max locked memory       (kbytes, -l) 64
max memory size         (kbytes, -m) 512000
open files                      (-n) 1024
pipe size            (512 bytes, -p) 8
POSIX message queues     (bytes, -q) 819200
real-time priority              (-r) 0
stack size              (kbytes, -s) unlimited
cpu time               (seconds, -t) unlimited
max user processes              (-u) 100
virtual memory          (kbytes, -v) unlimited
file locks                      (-x) unlimited

Why are cores disabled ?

© Super User or respective owner

Related posts about linux

Related posts about pam