Operating System - Linux
1827399 Members
4810 Online
109965 Solutions
New Discussion

Re: current limits of a process

 
SOLVED
Go to solution
Jdamian
Respected Contributor

current limits of a process

Hi

The configuration file /etc/security/limits.conf contains the limits per user.

Once a process is created (for instance, PID 333) its limits can be displayed using
cat /proc/333/limits
BUT only in some of my nodes... not in others

How can I select/unselect that feature?
Does it depend on kernel version or on a specific kernel module?

Thanx in advance
5 REPLIES 5
Jdamian
Respected Contributor

Re: current limits of a process

I agree that kernels before 2.6 hadn't this feature but all my nodes are 2.6 and some of them have it and other haven't.

For instance:
# uname -a
Linux mynode 2.6.18-8.el5 #1 SMP Fri Jan 26 14:15:21 EST 2007 i686 i686 i386 GNU/Linux

# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 5 (Tikanga)

# cat /proc/$$/limits
cat: /proc/13905/limits: No such file or directory
Goran Koruga
Honored Contributor

Re: current limits of a process

Hello.

'man 5 proc' says:

/proc/[number]/limits (since kernel 2.6.24)

Does this help?

Regards,
Goran
Matti_Kurkela
Honored Contributor
Solution

Re: current limits of a process

Interesting... apparently it's something RedHat has backported to both RHEL 4 and RHEL 5 kernels in later kernel RPMs.

This is a RHEL 4 system. Notice it has been updated since the initial release of RHEL 4:

$ cat /etc/redhat-release
Red Hat Enterprise Linux ES release 4 (Nahant Update 7)
$ uname -a
Linux myhost 2.6.9-78.0.17.ELsmp #1 SMP Thu Mar 5 04:58:34 EST 2009 x86_64 x86_64 x86_64 GNU/Linux
$ cat /proc/$$/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
[...]

According to kernel.org Gitweb, the /proc//limits feature was committed to Linus's main kernel source tree on 2007-10-19. I guess RedHat has backported it and included it to their RHEL 4 and RHEL 5 kernel updates at some date after that.

...Yes, looking at RHEL release notes, this feature was added in RHEL 5.2 and in RHEL 4.7.

(Wikipedia's RHEL page includes the release dates of each update release and links to the release notes, so it's easy to check the appropriate sets of release notes.)

MK
MK
Jdamian
Respected Contributor

Re: current limits of a process

thanx everyone