Operating System - HP-UX
1753826 Members
8815 Online
108805 Solutions
New Discussion юеВ

Can non-root users use unlimited for ulimit?

 
bbeuchaw
Occasional Contributor

Can non-root users use unlimited for ulimit?

Hello,

I've searched ITRC as well as the web and haven't found a definitive answer. I've also talked to HP support and didn't get a definitive answer - he couldn't give me a case number for some reason and also never emailed me any supporting doc for what he believed. :-(

So my question is: Can a non-root user use unlimited as a value for a ulimit command in sh (or ksh) on HP-UX (especially for data and stack limits)? Federico from HP believed a non-root user could not use unlimited, and my experience has pretty much supported that.

Thanks for any info!
8 REPLIES 8
Steven E. Protter
Exalted Contributor

Re: Can non-root users use unlimited for ulimit?

Shalom,

Yes this is often done for the oracle user to make the oracle database function normally.

Try doing it in a regular user's .profile

Some things you just have to test.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Don Morris_1
Honored Contributor

Re: Can non-root users use unlimited for ulimit?

A non-root user can only raise their soft limit, not their hard limit. The hard limit never defaults to RLIM_INFINITY [rather the usual default is determined by the appropriate tunable]. Finally, the soft limit may not be above the hard limit.

Hence by logic -- a non-root user may never set their soft limit to RLIM_INFINITY unless they _started_ there (which would require a root user to set it in the first place for a parent process).
bbeuchaw
Occasional Contributor

Re: Can non-root users use unlimited for ulimit?

Thanks for the reply, I did test previously with a regular user and got the following results, which is why I asked y'all. :-)

$ ulimit -s unlimited
sh: ulimit: The specified value exceeds the user's allowable limit.
$ ulimit -d unlimited
sh: ulimit: The specified value exceeds the user's allowable limit.

maxdsiz and maxdsiz_64bit are the kernel tunables that I can set for data; maxssiz and maxssiz_64bit are the kernel tunables that I can set for stack. Both have to be set to a number, and I'm not sure that even if I set those tunables to the highest number I can set them to will let me use unlimited (for either hard or soft limits) for stack and data as a regular non-root user. I don't think I have a test system handy that I can use to max those values out and test that way, but I'll see if I do and reply back with my findings.

Was just hoping someone could say yes or no definitively based on something buried deep in the bowels of docs.hp.com or somewhere in some OS code (since my search skills apparently aren't up to snuff to find anything about it). :-)

Thanks...
Dennis Handly
Acclaimed Contributor

Re: Can non-root users use unlimited for ulimit?

>Can a non-root user use unlimited as a value for a ulimit command in sh (or ksh) on HP-UX (especially for data and stack limits)?

Nobody can use unlimited for the data and stack, not even root. These are bounded by kernel parms.

>I'm not sure that even if I set those tunables to the highest number I can set them to will let me use unlimited for stack and data as a regular non-root user.

Right, you can only set them to the value of the kernel parm.

>I can use to max those values out and test that way

Be very careful of increasing maxssiz to the max, you may not be able to boot.

>Was just hoping someone could say yes or no definitively

The answer for all practical purposes is no, you can't be unlimited for the segment sizes.

>Don: which would require a root user to set it in the first place for a parent process.

Yes but even a root user must answer to a higher authority and be limited by the kernel parms. ;-)

Perhaps it is useful in that if the root user also changes the kernel parm, he doesn't have to use ulimit again, or relogin.
Dennis Handly
Acclaimed Contributor

Re: Can non-root users use unlimited for ulimit?

>Can a non-root user use unlimited as a value for a ulimit command

You can set the corefile size to unlimited. But I guess this is a ulimit bug where it displays "4194303" when it is already unlimited?
Don Morris_1
Honored Contributor

Re: Can non-root users use unlimited for ulimit?

No, root _can_ set the limit to unlimited. (At least on v3 -- and maybe with some patch level on priors... I don't recall all the details of when this went in and don't really want to track it down because I find it a bit odd -- I expect it was done just for standards compliance).

All that means is that rlimit/ulimit _reports_ unlimited, however. The actual meaningful bound is still the kernel tunable.
Dennis Handly
Acclaimed Contributor

Re: Can non-root users use unlimited for ulimit?

>Don: All that means is that rlimit/ulimit _reports_ unlimited, however. The actual meaningful bound is still the kernel tunable.

Didn't I say that? :-)
Don Morris_1
Honored Contributor

Re: Can non-root users use unlimited for ulimit?

Regarding core size, yes -- I was speaking of data/stack limits. Sorry to be unclear.