Xref: utzoo comp.bugs.sys5:1012 comp.unix.wizards:16911 Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!apple!ric From: ric@Apple.COM (Ric Urrutia) Newsgroups: comp.bugs.sys5,comp.unix.wizards Subject: Re: ULIMIT adjustment in System V kernel creation Keywords: sysv, ulimit, filesystem Message-ID: <32409@apple.Apple.COM> Date: 13 Jun 89 22:44:46 GMT References: <252@chip.UUCP> <1989Jun9.142904.1778@eci386.uucp> Organization: Apple Computer Inc, Cupertino, CA Lines: 53 In article <1989Jun9.142904.1778@eci386.uucp> clewis@eci386.UUCP (Chris Lewis) writes: >In article <252@chip.UUCP> mparker@chip.UUCP (M. D. Parker) writes: >>Under the current System V R3 flavor of operating system I am using, >>our ULIMIT is gened up to max value. > >Oh you lucky sod! This is how it *should* be - makes everything else >so simple... > > >Remember that you can adjust the ulimit *down* without root privilege... > >Put in your /etc/profile: > >if [ $LOGNAME = ] >then > ulimit >fi > >Or, get fancy and do something like: > > ul=`sed -n -e '/^$LOGNAME[ ]/s/^.*[ ][ ]*//p' > /etc/ulimitsperuser` > if [ -n "$ul" ] > then > ulimit $ul > fi >[/etc/ulimitsperuser consists of tab separated username, ulimit value >pairs, one pair per line] > >remember: > - the user's shell runs /etc/profile and any shell settings/ > ulimit etc persist for that user. > - *any* user can lower ulimit for themselves, but only root can > raise it > >[Aside: it's too bad in a way that the shell you get doesn't run effective >id == 0 during execution of /etc/profile, and undoes this just before >executing your personal profile - would make upping ulimit or other similar >things easy to do on a per-user basis, though it would require some >co-operation from /etc/login and probably an explicit shell builtin to change >the effective userid back to the real] >-- >Chris Lewis, R.H. Lathwell & Associates: Elegant Communications Inc. >UUCP: {uunet!mnetor, utcsri!utzoo}!lsuc!eci386!clewis >Phone: (416)-595-5425 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.