5

Ulimit man page suggests -r option will set this but it only appears to be valid for the root user and there is no equivalent for setting it via /etc/security/limits?

Any ideas?

1
  • Hmm, it looks as though it can be set via smitty (this is AIX) but doesn't appear to show up in ulimit -a or in /etc/security/limits which is a bit confusing.
    – Jon
    Feb 23, 2010 at 12:17

1 Answer 1

3

You said AIX, but in the case of linux I think it would just be the -u limit switch. In Linux this states 'processes', but with bash, ulimit is just a interface to the setrlimit system call. This can be seen by running strace bash -c 'ulimit -u 10' which returns:

setrlimit(RLIMIT_NPROC, {rlim_cur=10, rlim_max=10}) = 0

The man page for setrlimit states:

RLIMIT_NPROC The maximum number of processes (or, more precisely on Linux, threads) that can be created for the real user ID of the calling process. Upon encountering this limit, fork(2) fails with the error EAGAIN.

So maybe it is the same for AIX? This link states: "AIX does not define RLIMIT_NPROC or RLIMIT_MEMLOCK resources.", but you might be able to find a more definitive answer on developerworks.

For the permissions issue, the solution may be to set the limit with root, and then su to the user you need to increase the limit for. I have had to do this for other resource limits in the past, for example, max open files. The limits.conf was not applied so I had do use sudo or su from root, and then the limit gets inherited.

You must log in to answer this question.

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