1847205 Members
2950 Online
110263 Solutions
New Discussion

set ulimit

 
SOLVED
Go to solution
Gary Yu
Super Advisor

set ulimit

Hello everyone,

I got a strange problem on setting ulimit on my HPUX11.0. I logged in as root user, and ran "ulimit -d", it said "data(kbytes) 65536", and I wanted to extended it, so I set " ulimit -dH 1028576" to set the hard limit to 1GB. But when I try to set the soft limit value to 1GB by running "ulimit -dS 1028576", it failed, said :

'su: ulimit: The specified value exceeds the user's allowable limit.'

So how I can set it? and if I set it as root user, will it automatically apply to other uers?

Thanks a lot!
Gary
5 REPLIES 5
Michael Tully
Honored Contributor

Re: set ulimit

Hi,

Try using this:

# ulimit -f unlimited
Anyone for a Mutiny ?
Darrell Allen
Honored Contributor

Re: set ulimit

Hi Gary,

Here's a little info but unfortunately not all you ask.

ulimit is built-in to the shell. Use man on the different shells to read about ulimit:

sh-bourne(1) Bourne Shell
ksh(1) Korn Shell
sh-posix(1) POSIX Shell
csh(1) C Shell
keysh(1) Key Shell

When you set ulimit, you are setting it for your shell. To set a ulimit for all users you would need to edit /etc/profile, /etc/csh.login, etc...

Darrell
"What, Me Worry?" - Alfred E. Neuman (Mad Magazine)
S.K. Chan
Honored Contributor
Solution

Re: set ulimit

The max value of "data" that you are trying to set is determined by the kernel parameter "maxdsiz". So you have to bump up "maxdsiz" for this to work. Use ..

# ulimit -aS

to look at your current soft limit setting.
Bill Hassell
Honored Contributor

Re: set ulimit

As mentioned, maxdsiz is a hard limit for all programs, regardless of ulimit values. Now if ulimit was set in /etc/profile, for instance: ulimit -d 12345 it will set a hard limit for all users that login and cannot be increased. That's why the sysadmin should use ulimit -Sd 12345 so that users that need to increase it can do so at a later time. Note that using ulimit without -S is the same as -H (hard limit).


Bill Hassell, sysadmin
Gary Yu
Super Advisor

Re: set ulimit

Yes, it's the kernel parameter, I changed the maxdsiz, and it works now.

thanks Bill and Chan!

Gary