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

[notes.]
Known supported OSes: Linux
Known supported FTP daemons: wu.ftpd, ProFTPD

0.5...

  * Thanks to admin@digitald.uk.com, who's responsible for this release

Another small update which crawls bgcheck half-way until 1.0.  I've noticed
it's getting kinda bulky, and I'm going to work on that whenever I get a
chance.  I'd love any suggestions, of course.  This release fixes the script
so it'll work for those of you running ProFTPD.  I'm now keeping track of
operating systems and FTP daemons that bgcheck supports correctly.  If you
are not listed above, please send me an e-mail [blue@altavista.net] and it'll
be featured in the next release.  Thanks again for all the help.  Give me
suggestions, as always.

0.4...

  * Thanks to taylor@tequila.zimcity.net for some more contributions

Hi, after two months here's another release.  There's not much fresh, but
I've gotten the FTP bug debugged, I believe.  It may not work with daemons
that aren't wu-ftpd, but I hope that's not the case.  Since I couldn't find
out a technical way of going about this, there's a possibility.  If you do
continue to have problems, please send me an e-mail with the specifics, a
ps -auxw output, OS, etc.  Also, the second new feature allows you to
except programs instead of just users.  This has to be case sensitive or
it will not work, as with most everything in this script.  Sorry for the
long delay, I'm nearing the end of school and it's hectic!

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_03 built for i586-linux
  -- I would suggest the 5.x series at minimum
  [many lines omitted]
root@blue[~]# ps -V
  ++ procps version 2.0.2
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.8 #1 Wed May 12 02:16: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.
