[K12OSN] scripting advice re teachertool

David Trask dtrask at vcsvikings.org
Fri Jan 13 15:41:42 UTC 2006


In teachertool I'm noticing that some stubborn processes can cause a user
to linger even when we try to log them off....I've adapted this script to
kill off lingering users

#!/bin/sh
# usage  stop username
# stop
# script to logoff a student
#

if [ $1 != "root" ]
then
   for i in $(pgrep -u $1)
   do
      kill -9 $i
   done
else
   clear
   echo "Can't kill the root!!"
fi


Eric's script works well too....I remember the thread a few years ago that
spawned his script....I used the subject line "How to kill users"...I got
lots of hilarious responses.



"Support list for opensource software in schools." <k12osn at redhat.com> on
Thursday, January 12, 2006 at 7:59 PM +0000 wrote:
>I log users off like this in fl_TT
>
>skill -15 -u user || skill -9 -u user
>
>but I noticed Eric uses this method in his purge_users script
>
># first do it nicely
>pkill -u user
># wait a couple seconds
>sleep 2s
># now do it the hard way
>pkill -9 -u user
>
>are there any differences or advantages to these methods??
>I ask because I'm getting reports of the first method not working 100%
>of the time.
>--
>Robert Arkiletian
>C++ GUI tutorial http://fltk.org/links.php?V19
>
>_______________________________________________
>K12OSN mailing list
>K12OSN at redhat.com
>https://www.redhat.com/mailman/listinfo/k12osn
>For more info see <http://www.k12os.org>



David N. Trask
Technology Teacher/Director
Vassalboro Community School
dtrask at vcsvikings.org
(207)923-3100





More information about the K12OSN mailing list