Permanence

We've demonstrated that, within its operational framework, one can indeed query and set per-process resource limits using frontends, such as ulimit, prlimit(1), as well as programmatically via library and system call APIs. However, the changes we wrought are temporaryfor that process's life or the session's life only. How does one make a resource limit value change permanent?

The Unix way is to use (ASCII-text) configuration files that reside on the filesystem. In particular, on most Linux distributions, editing the /etc/security/limits.conf configuration file is the answer. We shall not delve further into the details here; if interested, check out the man page on limits.conf(5).

Get Hands-On System Programming with Linux now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.