Shutdown logs out instead of shutting down

Solution 1:

I found this issue reported as a bug for 10.04 and 10.10. Supposedly it has been fixed for those versions. Guess it was a problem with ConsoleKit.

https://bugs.launchpad.net/ubuntu/+source/consolekit/+bug/554158

However, there appears to be either a regression or entirely new cause of this infernal behaviour in the 11.xx series. I inconsistently experience this problem on 11.10. See this associated bug report:

https://bugs.launchpad.net/ubuntu/+source/gnome-session/+bug/838792