bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ulimit -c unlimited


From: 積丹尼 Dan Jacobson
Subject: Re: ulimit -c unlimited
Date: Wed, 26 Jul 2017 22:22:49 +0800

$  ulimit -c
0
$  ulimit -c 99
$  ulimit -c
99
$  ulimit -c 9999999999999999999999999999999999999999999999
bash: ulimit: 9999999999999999999999999999999999999999999999: limit out of range
$  ulimit -c 9999999999999999999999999999999
bash: ulimit: 9999999999999999999999999999999: limit out of range
$  ulimit -c 9999999999999999999
bash: ulimit: 9999999999999999999: limit out of range

Hmmm, maybe make the above error message say what the range is, so the
user doesn't have to probe it. Or say "do ... to see the valid range".


$  ulimit -c 9999999999999
bash: ulimit: core file size: cannot modify limit: Operation not permitted
$  ulimit -c 9999999999
bash: ulimit: core file size: cannot modify limit: Operation not permitted
$  ulimit -c 999999
bash: ulimit: core file size: cannot modify limit: Operation not permitted

By this time the user has probably given up... thinking that it isn't
the value that is the problem, but the basic Operation. (But if he
probes further, indeed some values work.)

$  ulimit -c 99
$  ulimit -c 999
bash: ulimit: core file size: cannot modify limit: Operation not permitted

Odd, a little later I try
$ ulimit -c 99
bash: ulimit: core file size: cannot modify limit: Operation not permitted

>>>>> "R" == Reuti  <reuti@staff.uni-marburg.de> writes:

R> Do you get this as root too?

I'm just trying to say the messages are confusing for the normal user.
I don't want make my report too big, so am not trying it for root.

R> If the hard limit is unlimited, then you can raise the soft limit
R> again also as normal user to be unlimited. So the statement "Operation
R> not permitted" is correct, although it means: "can't raise hard limit
R> again" as without -S or -H it sets both limits. The soft limit OTOH
R> can be changed between a value and unlimited as often as you like, as
R> the long as the hard limit stays to be set to unlimited.

Hmmm...Wait... I was using "help ulimit",
now I see on the bash man page

              The -H and -S options specify that the hard or soft limit is set
              for the given resource.  A hard limit cannot be increased  by  a
              non-root  user  once it is set; a soft limit may be increased up
              to the value of the hard limit.

So maybe that explains why the user can only set it once (99 above) then
cannot change it...

OK I recommend the "help ulimit" now say

      [-S|-H] -a        all current limits are reported
      [-S|-H] -b        the socket buffer size
      [-S|-H] -c        the maximum size of core files created
      [-S|-H] -d        the maximum size of a process's data segment
      [-S|-H] -e        the maximum scheduling priority (`nice')
      [-S|-H] -f        the maximum size of files written by the shell and its 
children

and perhaps the same on the bash man page.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]