Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need to apply "ulimit -s 256" to any system thread. Is there any way to achieve this under Ubuntu Server?

share|improve this question
What about /etc/security/limits.conf ? Doesn't it solve the problem? – HUB Jul 20 '11 at 13:07
up vote 3 down vote accepted

You can set user limits via pam_limits in /etc/security/limits.conf. See man limits.conf for informations about this file.

share|improve this answer

On Ubuntu 12.04 /etc/security/limits.conf does not appear to be read unless the following is added to /etc/pam.d/common-session.

session required

Even then, it's not clear to me if it is picked up for programs started by upstart scripts.

share|improve this answer
Note that there is also a commented line in /etc/pam.d/su: # session required – Vladimir Panteleev Jan 17 '13 at 8:00

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.