3

What is the difference between:

a) using the ulimit command to set a limit on a resource?

b) editing the /etc/security/limits.conf file for the same purpose?

e.g. what is the entry that should be placed in /etc/security/limits.conf to account for ulimit -n 8192 ?

Is the limit set by ulimit -n 8192 soft or hard?

For whom is it being set?

For the user running the command?

Or it becomes the default entry as if we were using domain=* in /etc/security/limits.conf

1 Answer 1

4

Changes made by ulimit will apply only to the current processes. If you need to make them permanent, you must edit /etc/security/limits.conf

About your 3rd question .. it depends what you run on your server, for certain applications you might need a higher number.

ulimit -n sets soft limit, ulimit -Hn sets hard limit.

3
  • 1
    Changes made by ulimit apply to the current process.
    – JdeBP
    Jan 12, 2017 at 13:20
  • @JdeBP does this affect spawned processes too? they will inherit the ulimit set by their parent (or ancestor in general)?
    – pkaramol
    Jan 12, 2017 at 15:33
  • Not if they have already been forked, which parts of the current session may well have been.
    – JdeBP
    Jan 12, 2017 at 16:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .