1752565 Members
5440 Online
108788 Solutions
New Discussion юеВ

HPUX 11i ulimit

 
zimin chai
New Member

HPUX 11i ulimit

Question:
Why does ulimit of file(blocks) produce different results based on how the command is run?

Scenario:
When root runs su - oracle "ulimit -a" from the command line, the output is as follows:
time(seconds) unlimited
file(blocks) unlimited
data(kbytes) 655360
stack(kbytes) 8192
memory(kbytes) unlimited
coredump(blocks) 4194303
nofiles(descriptors) 1536

When root runs su - oracle -c "ulimit -a" as a cron job, the output is as follows:
time(seconds) unlimited
file(blocks) 4194303
data(kbytes) 655360
stack(kbytes) 8192
memory(kbytes) unlimited
coredump(blocks) 4194303
nofiles(descriptors) 1536

Thank you for your help.

Zimin
4 REPLIES 4
Peter Godron
Honored Contributor

Re: HPUX 11i ulimit

Zimin,
can't help with why, unless it's down to environment not being being picked up in cron.

For a cheat way around:
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=759940
See A.Clay's answer towards the end of the thread ;-)
zimin chai
New Member

Re: HPUX 11i ulimit

Peter,
Thanks for the reply!
I agree that it is because the environments are not completely picked up via cron. Thought that HP might have a patch to fix this...
Bill Hassell
Honored Contributor

Re: HPUX 11i ulimit

You don't want a patch to fix this behavior. cron is NOT a login, it is a way to run processes on behalf of a particular user. cron (and batch and at commands) are specialized environments and it is up to the script writer to ensure that the necessary (not always complete) environment settings are established within the job. Never rely on $PATH or other global settings in these jobs -- explicitly code them or better yet, source a standard environment at the beginning of the script, something like /etc/oracle-setup. Then all your jobs, whether run from a login shell or from cron will have the same environment.


Bill Hassell, sysadmin
Peter Godron
Honored Contributor

Re: HPUX 11i ulimit

Zimin,
could you please let us know if any of our answers helped. If so, can you please read:
http://forums1.itrc.hp.com/service/forums/helptips.do?#28