On 8/8/06, James D. Parra <Jamesp@musicreports.com> wrote:
Hello,
Short of rebooting, how to close an open session of a user who is logged in?
Here is what we use on one of our LTSP servers. It's not a good way to do it, there must be better way to logoff users than killing all the processes belonging to that user. Linux being multisuser system, there must be simpler way of doing this if there already isnt. Till then this one works -J #!/bin/bash echo -n "enter username to log out:" read user ps U $user | cut -d "?" -f 1 > /tmp/killuser.txt find /tmp -user $user ? /tmp/usertmpfiles.txt cat /tmp/killuser.txt | \ while read pid do kill -9 $pid done cat /tmp/usertmpfiles.txt | \ while read filename do rm -f $filename rm -f /tmp/killuser.txt rm -f /tmp/usertmpfiles.txt done echo "User logged off"