ULIMIT adjustment in System V kernel creation
Dick Fong
fongd at csusac.uucp
Wed Jun 14 18:55:13 AEST 1989
I didn't have a need or desire to work with system v until
recently (used vax and suns mainly).. and still I don't have
a desire to do so.. the question I have is what is the purpose
of ulimit?? it's really doesn't limit a user to the space
s/he uses.. it just makes it very annoying.. the user
just ends up with a lot of 1 meg (or what every the ulimit is
set to) files..
well.. unfortunately, we didn't have source to our kernel..
but we did make two patches to our kernel..
the first one was to take out the check in the ulimit to
see if the user was root.. thereby making it possible for
ANY user to up their ulimit.. the second was to make the
initial ulimit to be 16 megs.. 16 megs (0x7fff) is the max
you can set without some severe kernel hacks.. the first
patch isn't all that simple but it wasn't hard, the second
one is quite easy.. (a total of 4 bytes were changed for both
patches) for patch two:
all you need to do is read out 'main' from the kernel (with
the help from 'nm' and simple program that seeks to a location
in a file and read out a certain amount of bytes and write
out what it finds to a file) and look for where the default
value is loaded (with either 'hd' or 'od').. (we were lucky
that our 'main' in our kernel only had one 0x0800.. which was our
default ulimit...) and find the bytes surrounding it..
after you know what you are looking for, write a simple program
that will look for that certain byte sequence and change it in
your kernel. the one thing you should make sure of is that you
only find ONE occurance of this byte sequence (i.e. you don't make
this change to something else in the kernel.. it would
most likely be bad...) when we did this, we were quite
paranoid of the actual bytes we changed.. so our program
we wrote double checked the locations where we made the
changes.. after that, reboot and the ulimit should be changed..
either that or you've mangled your kernel..
as I said, I'm not sure if this works for anything else
besides a 3b15 running release 2.x.. and even then.. I
won't say it will work on your system, but our system is
running much happier now..
I've heard rumor that the ulimit value will be a kernel
variable in some later release.. which makes life much
easier if you want to change it..
--
----------------------------------------------------------------------
Dick Fong <*:*> UUCP: {ucdavis|lll-crg}!csusac!fongd
Internet: fongd at csusac.csus.edu
More information about the Comp.unix.wizards
mailing list