After I login using UI, I am logged out.Shall I start by looking on log files ? Which one.I have root authority on the system.Is putting a pause or sleep in a script file that gets executed during login or  logout is the place to start?  If yes, which file? Note: 1. If I login using terminal , I am fine. 2. This is happening for every user.
What is the step by step procedure to analyze automatic logout on a linux ( ubuntu) system
linux;bash;login;logout
Sources from various people were helpful in leading me to right direction. I examined /var/log . It had t has alternatives.log   bootstrap.log    kern.logalternatives.log.1 btmp  kern.log.1  btmp.1 unattended-upgrades/ apport.log      ConsoleKit/   upstart/    apport.log.1 cups/ wtmp dist-upgrade/  lastlog dmesg lightdm/   Xorg.0.log dmesg.0     nvidia-prime-upstart.log prime-offload.log Xorg.1.log  dpkg.log    prime-supported.log samba/   apt/  speech-dispatcher/  auth.log  faillog syslog fontconfig.log  fsck/  gpu-manager.log Xorg.failsafe.log hp/ boot.log installer/Then I used: ls -ltr and saw that the first file modified for today ( after I attempted to login was)  nvidia-prime-upstart.log. nvidia-prime-upstart.loghad this line Sorry but your hardware configuration is not supported. Now I wanted to list all packaged that had nvidia in name.I used dpkg --get-selections | grep nvidia. Then I uninstalled the unneeded packages. The reason of unneeded packages was that I had installed nvidia driver and cuda programming packages in a blind enthusiasm to learn CUDA programming! 