Ulimits strikes again (SYSV)

Guy Harris guy at sun.uucp
Tue Sep 3 14:52:06 AEST 1985


> [Question about how to administatively set the ulimit]
> 
> This isn't so hard to do, without changing ulimit code.  Just use inittab to
> set ulimit to some astronomical value at boot time (the line should have the
> default rstate and an action of boot).  Then set ulimit down to any desired
> value in /etc/profile.

Sorry, this won't work.  The action in question will be spawned by "init"
and be a child of "init".  It will cheerfully set its own "ulimit" and that
of all its children, and "init" will cheerfully ignore that change and pass
the old stupid "ulimit" down to everything else it kicks off.  The file size
limit is like the current directory; you can't change it in a subprocess and
expect it to affet you.

> Even changing the default value used by ulimit sounds like a minor code
> change (if you have source of course).

It isn't hard once you find it.  Just change the CDLIMIT parameter in
<sys/param.h>.  (This is in S5; S3 embedded the constant "1L << 11" into
the source code of "main.c".)  If you don't have source, you might get
somebody to try to find where the number is hidden and patch it.

Now, would somebody in the USDL *PLEASE* do the following:

	cd <wherever>
	get -e SCCS/s.param.h
	ed param.h
	/CDLIMIT/s/(1L<<11)/0x7fffffff/
	w
	q
	delta SCCS/s.param.h
	Gave UNIX a sane initial ulimit value.
	^D
	rm param.h
	get SCCS/s.param.h

	Guy Harris



More information about the Comp.unix.wizards mailing list