MacBook Pro keeps returning to login screen I can login to safe boot without issue. I created a new admin account through safe boot, but upon first full login into this new account, the same behaviour as in the title showed up instantly.

I have tried Apple diagnostics boot which revealed no hardware issues. I have also tried deleting contents of /Library/Preferences and ~/Library/Preferences (for new account) but this does not seem to resolve the issue.



Macbook pro 15" (discrete graphics) late 2013 on OS X 10.10.3
I found this problem after not using my MacBook for a while. 
I removed the battery. Pressed the on button for 30 seconds with the battery removed and power chord unplugged. 
Put the battery back in. Restart, and mine was o.k