#!/bin/sh
/usr/X11R6/bin/sessreg -d -w /var/log/wtmp -u /var/run/utmp -l $DISPLAY $USER

# Delete cached CIFS password file.
if [ -f /tmp/cifs/passwd ]; then
   rm -f /tmp/cifs/passwd
fi

/usr/X11R6/bin/xsetroot -solid black

SETUPPID=`pidof IBMSetup`
if [ -n "$SETUPPID" ]; then
        killall -w IBMSetup

fi

# Send the logout trap with the name of the user was just logged out
cur_user=`cat /tmp/snmp/user`



if [ -f /bin/nice ]; then
  /bin/nice -n +5 /IBM/bin/gentrap 6 2 '/etc/gdm/PostSession/Default' 200 $cur_user &           
else
  /IBM/bin/gentrap 6 2 '/etc/gdm/PostSession/Default' 200 $cur_user &           
fi

# Now indicate to snmp that noone is logged in.
echo '<none>' > /tmp/snmp/user

if [ -n "`/sbin/pidof gdm`" ]; then
   killall -w gdm
else
   killall -w X
fi



