Some of our users are having problems logging into their terminals. This seems to be because some processes are still running from a previous session. We found a script that we added to Xreset that will kill all of a user's processes. This is overkill, though, and specifically will prevent people from being logged into more than one terminal at once.

Is there a way to identify all of a user's processes associated with a specific session, so we could then kill them? Thanks in advance.

Ken

Here's what we've currently got in /etc/kde/kdm/Xreset. All the comments up to the first echo were already there:

#! /bin/sh
# Xreset - run as root after session exits

# Reassign ownership of the console to root, this should disallow
# assignment of console output to any random users's xterm
# This is not required if you use PAM, as pam_console should handle it.
#
#chown root /dev/console
#chmod 622 /dev/console

#exec sessreg -d -l $DISPLAY $USER

echo `date` About to sessreg for $USER >> $LOG

#This script lifted from:
#http://www.skolelinux.no/~klaus/newnotater/x4181.html, 4/27/07
# License: GPL
[EMAIL PROTECTED]
#This script can be saved as /usr/local/bin/finish.sh
#remember chmod 755 /usr/local/bin/finish.sh
LOG=/var/log/xreset_ltsp_stray.log
GREP=/usr/bin/pgrep
KILL=/usr/bin/pkill

echo `date` Killing Processes for $USER >> $LOG
$GREP -d ', ' -l -u $USER >> $LOG
echo >> $LOG

# root can do whatever he wants
[ -x $KILL ] || exit
[ "$USER" -a "$USER" != "root" ] || exit
# first let's be polite
$KILL -u $USER
#then we wait 5 seconds
sleep 5s
#before we finally finish them off
$KILL -9 -u $USER

-----------------------------------------------------------------------
p.s.,  Note to self--this is still working on bug 20595!

begin:vcard
fn:Kenneth Tanzer
n:Tanzer;Kenneth
org:Downtown Emergency Service Center;Information Services
adr:;;515 Third Avenue;Seattle;WA;98104;USA
email;internet:[EMAIL PROTECTED]
title:Director of Information Services
tel;work:(206) 464-1570 x 3061
tel;fax:(206) 624-4196
x-mozilla-html:TRUE
url:http://www.desc.org
version:2.1
end:vcard

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_____________________________________________________________________
Ltsp-discuss mailing list.   To un-subscribe, or change prefs, goto:
      https://lists.sourceforge.net/lists/listinfo/ltsp-discuss
For additional LTSP help,   try #ltsp channel on irc.freenode.net

Reply via email to