I have recently upgraded to Mountain Lion from Snow leopard and now the system will not always go to the login screen. (iMac 27" circa 2010 standard as it came from Apple no upgrades)
I have tried disconnecting all devices and uninstalling all non essential software.
To get the login screen I have to hard switch of the machine off then after 20 30 seconds turn it back on it sometimes goes to the login screen.
If I start in safe mode then reboot it always goes to the login screen.