LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 11-06-2013, 10:26 AM   #1
zQUEz
Member
 
Registered: Jun 2007
Distribution: Fedora, RHEL, Centos
Posts: 294

Rep: Reputation: 54
limits.conf + nproc weirdness


Hi all,
hoping someone can direct me to where to next look to figure out what I think is a strange issue:

I have a CentOS5 server with the following /etc/security/limits.conf entries that relate to "nproc":
Code:
oracle	soft	nproc	2047
oracle	hard	nproc	16384
*	hard	nproc	16384
if I run command
Code:
ps -u oracle |wc -l
it returns 1612 processes (fluctuates but not by more than 10-20).
the server has been online for 220 days and no issues.

Today, if I try and `su - oracle` i get error
Code:
"su: cannot set user id: Resource temporarily unavailable"
When I comment out the "soft" limit for nproc (oracle), I can now su without issues.

The fix doesn't makes sense to me as to why it fixed the issue. My questions are:
1) if my ps listing only shows ~1600 PID's for oracle, why would this soft limit be affecting me.
2) total PID's running (all users) is 2044 - coincidence that it is so close to the soft limit?
3) I thought the soft limits were per-process limits (per man), not system-wide limits for a user. In other words, each oracle process is allowed to launch the specified soft limit (up to hard if they change it). Am I mistaken on that?

thanks for any help.
 
Old 11-06-2013, 11:20 AM   #2
Ygrex
Member
 
Registered: Nov 2004
Location: Russia (St.Petersburg)
Distribution: Debian
Posts: 666

Rep: Reputation: 68
1.
this command should be more honest:
Code:
ps H -u oracle |wc -l
3.
you are correct; it is like this:
new session is opening by UID*→ pam_limits reads /etc/security/limits.conf*→ and sets them with setrlimit()*→ shell clone()s /* EAGAIN may occur here */ and child have the same limits → child execve()s and limits are preserved

child may change EUID to be excluded from parent's limited resources
 
1 members found this post helpful.
Old 11-06-2013, 12:48 PM   #3
zQUEz
Member
 
Registered: Jun 2007
Distribution: Fedora, RHEL, Centos
Posts: 294

Original Poster
Rep: Reputation: 54
thaks Ygrex - that `ps` command really helped me out.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Setting limits in /etc/security/limits.conf vaibhav.vsk Linux - Security 1 09-20-2012 08:22 AM
Limits.conf digitaldude Linux - Server 2 10-27-2011 01:56 AM
etc/security/limits.conf - what does it do? Ken_1969 Red Hat 5 03-14-2010 04:25 PM
/etc/security/limits.conf reverse Linux - Security 4 10-20-2007 03:10 PM
limits are not working (limits.conf) PkerC Red Hat 3 06-22-2006 10:14 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 12:03 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration