6

I want to set systemwide ulimit on ubuntu (all processes, all users).

How can I set it?

thanks

JP

6

You can set these in /etc/security/limits.conf on Red Hat systems. I think it's the same on Ubuntu. It has examples by default, they're pretty straightforward. Post back if you have problems.

In /etc/security/limits.conf add:

root - core unlimited
*    - core unlimited

You will need to log out and log back in before the limits are applied to your session.

3
  • thanks. it looks pretty configurable. I had seen some tutorial where they set "ulimit -s 512" somewhere in rc.d, which limited the mysql and other processes' virtual memory. I forgot where exactly it was done. Is this method equivalent? If so, what is the equivalent setting in limits.conf? – JP19 Dec 28 '10 at 17:21
  • Try man limits.conf to get details on which settings to use. They are also detailed in the header of limits.conf. – BillThor Dec 28 '10 at 19:26
  • Note that these settings do not really apply system-wide. They apply only to processes spawned from an user session (the user's processes and their children after his login). These limits are set by a PAM module pam_limits.so during user's login. --- The processes started by init / systemd (or other alternative) and their children - i.e. system daemons - will not be limited by anything from /etc/security/limits.conf. – pabouk Sep 19 '17 at 12:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy