Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
    
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 '10 at 12:17

1 Answer 1

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.