[K12OSN] Student Process Reaper Script

Henry Burroughs hburroughs at HHPREP.ORG
Fri Sep 3 13:52:27 UTC 2004


I wrote a script this morning to keep the students in my classes from
playing games/chess/web browsing during my classes (I don't want to
uninstall games, and that doesn't stop the browsing).  Basically, the
script is an infinite loop (always wanted to have a "while (true)" loop)
that reads 2 variables from a file that you specify on the command line
(ctrl-c stops it).  It just loops and does a ps list for each user and
picks the pids of the programs you don't want them to run, and kills
them... here's the contents from my 1st period file I use:

#1st_period.reap
#1st Period - no mozilla, no chess, no Maelstrom
REAP_USERS="cfraser afuller mandrews rladd cpawley"

REAP_PROGS="mozilla-bin gnuchess Maelstrom"


So I run ./class_reaper.sh 1st_period.reap


You have to run it as root at the moment...  DO NOT RUN THIS USING
SUDO!!!!!!!!!!!
As you can imagine, a malicious user who has access to run it could
terminate any users programs, as well as gdm, root, etc!!!!  If someone
wants to make it SUDO safe (ie: protect root, etc... or users under a
UID # range), and not kill users within specific groups (ie:
Faculty).... you are quite welcome to.

I've thought about making it interactive... ie: as students finish an
assignment, I can release them while not having to terminate the script
and reload the new text file.



Henry Burroughs 
Technology Director
Hilton Head Preparatory School
www.hhprep.org
hburroughs at hhprep.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/k12osn/attachments/20040903/26219e05/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: class_reaper.sh
Type: text/x-sh
Size: 1210 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/k12osn/attachments/20040903/26219e05/attachment.bin>


More information about the K12OSN mailing list