Ulimit values in limits.conf vs 20-nproc.conf

5,059

The Red Hat KB notes:

After reading /etc/security/limits.conf, individual files from the /etc/security/limits.d/ directory are read. The files are parsed one after another in the order of "C" locale. So the order will be special characters, numbers in ascending order, uppercase letters and lowercase letters in alphabetical order. If two files have same entry, then the entry read last will be taken in effect. Only files with *.conf extension will be read from this directory.

A directory of configuration fragments offers the ability for various packages to provide the settings they need. A Debian mailing list item offers this insight:

Once upon a time, most UNIX software was controlled by a single configuration file per software package, and all the configuration details for that package went into that file. This worked reasonably well when that file was hand-crafted by the system administrator for local needs.

When distribution packaging became more and more common, it became clear that we needed better ways of forming such configuration files out of multiple fragments, often provided by multiple independent packages. Each package that needs to configure some shared service should be able to manage only its configuration without having to edit a shared configuration file used by other packages.

The most common convention adopted was to permit including a directory full of configuration files, where anything dropped into that directory would become active and part of that configuration.

Share:
5,059

Related videos on Youtube

pkaramol
Author by

pkaramol

Updated on September 18, 2022

Comments

  • pkaramol
    pkaramol almost 2 years

    In a CentOS/RHEL machine, the limit of user processes can be defined in /etc/security/limits.conf as well as in /etc/security/limits.d/20-nproc.conf

    What is the difference in those two values contained in the above files?

    • Atul Vekariya
      Atul Vekariya about 7 years
      No difference. Usage of limits.d is just for separation