bgcheck 0.3
blue [blue@altavista.net]
http://blue.dhs.org/bgcheck

[notes.]
0.3...
  * Thanks to both jonathon@leto.net and taylor@gws.org for contributions
  * $mail and $violate options both do not work under $test conditions

Moving along steadily... Thanks for the comments and suggestions.  They're
helping me get things together.  In this version, the script gets even more
Linux dependent (could you imagine?) -- the new method of measuring the
amount of memory that is used reads from /proc/meminfo.  I figured this
would be ideal since it's pretty much already had the hots for Linux.

[intro.]

bgcheck is a process monitor for linux written in perl.  it can be a very
useful tool for administrators used to limit the amount of background
processes that each user can run.  i wrote this as a perl exercise and
because i've never seen one (but i'm sure there are many).

the method that bgcheck uses to select the processes to kill is that it
selects the ones that are using the most memory.

the way you can put this into exercise is to simply crontab it to run
every 10-15mins or so.  ex:

0,10,20,30,40,50 * * * *	/usr/local/bin/bgcheck 1>/dev/null 2>&1

please consult the bgcheck file for furthur instructions.  to do this,
simply load it with your favorite text editor.  configuration is easy
and self-explanatory.

note: you need to be root.

[prereq.]

++ = program output
-- = author comment

root@blue[~]# perl -v
  ++ This is perl, version 5.005_02 built for i586-linux
  -- I would suggest the 5.x series at minimum
  [many lines omitted]
root@blue[~]# ps -V
  ++ procps version 1.2.7
root@blue[~]# ps aux
  [many lines omitted]
  ++ root         1  0.0  0.4   216   132  ?  S    10:35   0:03 init
  [many lines omitted]
  -- make sure yours looks something like this
root@blue[~]# ls /proc/meminfo
  ++ /proc/meminfo
  -- VERY linux dependent
root@blue[~]# uname -a
  ++ Linux blue 2.2.3 #1 SMP Tue Mar 9 17:56:22 CST 1999 i586 unknown
  -- Linux is probably required, as long as ps output is identical

[author.]

direct contact: eulb@efnet; blue@altavista.net

props to my mentor/guru anut [nads@bleh.org] for moral/tech support

i would appreciate any comments/suggestions on this product; there is
no license meaning do whatever you please (i.e. cherish, "borrow", etc.)
but use common sense and I ask that you do not simply take the code and
replace every occurance of "blue" with "your-name-here".

thank you.
