ULIMIT adjustment in System V kernel creation

Chris Lewis clewis at eci386.uucp
Sat Jun 17 02:55:38 AEST 1989


In article <32409 at apple.Apple.COM> ric at Apple.COM (Ric Urrutia) writes:

>Another way of doing it would be to write a c program that sets ulimit
>to some value and then exec's /etc/getty.  You could call it something
>like ungetty and pass it an argument (whatever ulimit you wanted).  Then
>you could simply replace the getty entries in /etc/inittab with the 
>name of your new program.  This seems a lot cleaner and you can set the
>ulimit to whatever you want per tty.

But then you have to change the semantics of the /etc/inittab line, perform
argument parsing etc.  What'll you break?  (tty line administration
utilities like ISC sysadm).  What happens if you make a mistake like putting
non-numeric characters in the inittab entry (you *might* not be able to log 
in again...)  Why bother?

Stock SV getty doesn't even provide an opportunity to set TERM!

REMEMBER: getty doesn't know who you are.  Getty is an ideal place for
line-specific initializations (TERM), but not user-specific.
[Ie: why would you want to set ulimit on a per-line basis?]

It seems to be that the correct way to limit file size is during /etc/profile.
(because user initializations are what it is for...)

And that the correct default ulimit is infinity (or as near to it as you
can get...).

If your system has a low default, make it (almost) infinity by moving 
/etc/getty to /etc/realgetty, and compile the following and install as 
/etc/getty:

		main(argc, argv) int arc; char **argv; {
		    ulimit(2, 0x7fffffff);
		    execv("/etc/realgetty", argv);
		}

Then one line of shell script in your /etc/profile plus a per-user list can
tune ulimit to anything you want.

Actually, the getty thing should be done to init instead so that all processes
get the higher ulimit.  However, making a mistake can have somewhat greater
consequences....
-- 
Chris Lewis, R.H. Lathwell & Associates: Elegant Communications Inc.
UUCP: {uunet!mnetor, utcsri!utzoo}!lsuc!eci386!clewis
Phone: (416)-595-5425



More information about the Comp.unix.wizards mailing list