Article View: comp.bugs.sys5
Article #7Re: ULIMIT adjustment in System V kernel creation
From: Chris Lewis
Date: Fri, 16 Jun 1989 16:55
Date: Fri, 16 Jun 1989 16:55
46 lines
2540 bytes
2540 bytes
In article <32409@apple.Apple.COM> ric@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
Technical Details
Message-ID:
<1989Jun16.165538.27038@eci386.uucp>Path:
arc1-ca.pugleaf.net!utzoo!attcan!lsuc!eci386!clewisReferences:
<252@chip.UUCP> <1989Jun9.142904.1778@eci386.uucp> <32409@apple.Apple.COM>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!lsuc!eci386!clewis From: clewis@eci386.uucp (Chris Lewis) Newsgroups: comp.bugs.sys5,comp.unix.wizards Subject: Re: ULIMIT adjustment in System V kernel creation Keywords: sysv, ulimit, filesystem Message-ID: <1989Jun16.165538.27038@eci386.uucp> Date: 16 Jun 89 16:55:38 GMT References: <252@chip.UUCP> <1989Jun9.142904.1778@eci386.uucp> <32409@apple.Apple.COM> Reply-To: clewis@eci386.UUCP (Chris Lewis) Organization: R. H. Lathwell Associates: Elegant Communications, Inc. Lines: 47