1846643 Members
1980 Online
110256 Solutions
New Discussion

ulimit exeeds limit

 
SOLVED
Go to solution
Klaus  Frank
Frequent Advisor

ulimit exeeds limit

Hallo to all
Three times a day I raise /usr/dt/bin/dtpad to write my daily workdiary. This is sheduled by "at". Each time the at-job generates the following error mail message:

sh[36]: ulimit: The specified value exceeds the user's allowable limit.
Cron: The previous message is the standard output and standard error of one of your at commands.

# ulimit -f returns: 4194304
Any attempt to increase this value is rejekted by the following error message:

# ulimit -f 4194305
ksh: ulimit: bad number

Now the questions:
How can I avoid these error messages ?
How can I increase the ulimit value ?
What system files should I lock at ?

thanks for any usefull answers
Klaus
... we all can make it with a little help ...
3 REPLIES 3
Alex Glennie
Honored Contributor

Re: ulimit exeeds limit

ulimit -s xxxxx where xxxxx is the number of kbytes to use cannot
exceed the system kernel parameter maxssiz. So if the ulimit is at
the value of maxssiz, then maxssiz will need to be increased. Note
that this requires a new kernel to be built and a reboot.

For example:

1. ulimit -a

time(seconds) unlimited
file(blocks) unlimited
data(kbytes) 2015464
stack(kbytes) 81584
memory(kbytes) unlimited
coredump(blocks) 4290772993
nofiles(descriptors) 2048

2. echo maxssiz/D | adb /stand/vmunix /dev/kmem
maxssiz:
maxssiz: 20396

3. echo "4 * 20396" | bc
81584
John Palmer
Honored Contributor
Solution

Re: ulimit exeeds limit

Hi,

This is a known problem in 10.20.

To fix it, edit the file /var/adm/cron/.proto and change the line:-

ulimit $l

to:-

if [ $l = 4194304 ];
then ulimit unlimited
else ulimit $l
fi

Regards,
John
Carol Garrett
Trusted Contributor

Re: ulimit exeeds limit

SOLUTION ONE:
===============

To change the value of ulimit simply type ulimit
NEWVALUE

The problem is that when the at command checks the
ulimit under
/usr/bin/sh,
ulimit reports back the word "unlimited" or under ksh
ulimit reports
back
4194304 which is effectively no limit. The at command
doesn't like
either
answer. The only way I've found around it (without
setting a ulimit in
the
kernel) is to set my ulimit to 2000000 in a script
(see below) and have
the
script call at for me. Depending on what your user
does under his own
id, he
may want to just set his ulimit to 2000000 in his own
.profile.

#!/usr/bin/ksh
#at.sh to get around the ulimit problem
#
/usr/bin/at.sh:
ulimit 2000000
/usr/bin/at $*

SOLUTION 2
===========
you can check a users ulimit value by typing "ulimit"
on a unix prompt.
You can change the ulimit value by putting an entry "
ulimit 4194304"
at the
end in the .profile of that user.

Or in your case
Solve the problem by replacing ulimit $l in
/var/adm/cron/.proto file with these
lines:

if [ $l -eq 4194304 ]
then
ulimit unlimited
else
ulimit $l
fi

Please note that "$l" above is the
dollar sign ($)
followed by the lower case letter
'ell' (not the
number one). See proto(4) for its
special
meaning in this context.

SOLUTION 3
===========

When a job is submitted to at(1) the command:
ulimit 4194304
is included in the
/var/spool/cron/atjobs/.

Using the posix shell (/usr/bin/sh), the problem can
be reproduced at
the command line; ksh does not have the problem:
$ ulimit
unlimited
$ ulimit 4194304
sh: ulimit: The specified value
exceeds the user's
allowable limit.
$ ksh
$ ulimit 4194304
(no error)

In the case of interactive commands, you can avoid the
warning by
setting ulimit to 4194303 in the posix shell, or by
using ksh.

As pointed out previously, the at(1) job runs
correctly regardless of
this warning. To get rid of the warning from at(1)
jobs, you can limit
ulimit to 4194303. Do this by modifying the file
/var/adm/cron/.proto
to change the line:
ulimit $l
to:
ulimit 4194303