Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: umlimit and /etc/zshenv

Thorsten Haude wrote:
> Hi,
> I have the following line in my /etc/zshenv:
>     ulimit -c 20000
> 1. This is a legacy from the Bash. I read zsh's manpage but couldn't
> find a clear statement about what happens if neither -S nor -H are
> given.

If -H isn't set, soft limits are assumed.  The manual page is a little
elliptical, but reading what it doesn't quite say implies this --- -S is
there to allow you to set both types of limit at once.  The patch at the
bottom makes this clearer.

> 2. I get problems with this command when a process reduces the hard
> limit and calls a subprocess. So I wonder whether I get the semantics
> of /etc/zshenv and ulimit wrong and ulimit should in fact be in
> another /etc/z* file.
> Could someone explain where my error is?

I think you're saying you're reducing the hard limit, and then executing
a command (the one in /etc/zshenv) which tries to make the soft limit
higher than the hard limit.  I think that's the correct behaviour ---
there's no way it can increase the value past the hard limit, and zsh
happens to warn you it can't do that when other shells may not (you may
find bash returns status 1 even if it doesn't print anything).

If this is what is going on, you need to work around it somehow:  either
use the output from ulimit or limit to decide what the hard limit is, or
if you're not interested in the error message simply send it to
/dev/null with `2>/dev/null'.

> Im übrigen gilt ja hier derjenige, der auf den Schmutz hinweist,
> für viel gefährlicher als der, der den Schmutz macht.
> 	- Kurt Tucholsky

(In case anyone was wondering: in general the people who root out dirt
should be considered much more dangerous than those who make the dirt in
the first place.)

Index: Doc/Zsh/builtins.yo
RCS file: /cvsroot/zsh/zsh/Doc/Zsh/builtins.yo,v
retrieving revision 1.44
diff -u -r1.44 builtins.yo
--- Doc/Zsh/builtins.yo	20 Feb 2002 12:51:53 -0000	1.44
+++ Doc/Zsh/builtins.yo	10 May 2002 09:32:07 -0000
@@ -1281,7 +1281,8 @@
 item(tt(ulimit) [ tt(-SHacdflmnpstv) [ var(limit) ] ... ])(
 Set or display resource limits of the shell and the processes started by
 the shell.  The value of var(limit) can be a number in the unit specified
-below or the value `tt(unlimited)'.  If the tt(-H) flag is given use
+below or the value `tt(unlimited)'.  By default, only soft limits are
+manipulated. If the tt(-H) flag is given use
 hard limits instead of soft limits.  If the tt(-S) flag is given
 together with the tt(-H) flag set both hard and soft limits.  If no
 options are used, the file size limit (tt(-f)) is assumed.  If

Peter Stephenson <pws@xxxxxxx>                  Software Engineer
CSR Ltd., Science Park, Milton Road,
Cambridge, CB4 0WH, UK                          Tel: +44 (0)1223 392070

The information transmitted is intended only for the person or
entity to which it is addressed and may contain confidential 
and/or privileged material. 
Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by 
persons or entities other than the intended recipient is 
If you received this in error, please contact the sender and 
delete the material from any computer.

Messages sorted by: Reverse Date, Date, Thread, Author