Direct that the solution after the desktop stuck:
1. may wait a few minutes, the system will automatically react. You can choose to wait a few minutes.
2. The vast majority of cases the system will not react, this time can directly log the user into the tty terminal.
(1) Ubuntu has a six tty terminal, hold down Ctrl + Alt + F1 to enter the terminal tty1, (empathy Ctrl + Alt + F2, F3 and so can enter the other terminal tty1, where we only need to enter a tty terminal will be able to Solve the problem).
(2) After entering the tty terminal to enter your user name and password to log in.
(3) to re-execute the command log off the desktop Online:
sudo pkill Xorg
or
sudo restart lightdm
(4) After executing the above command wait two minutes, you will naturally want to see the interface.
Note: When the state stuck in the system, it is best not to force a shutdown. Ninety percent of the cases after the forced shutdown after re-boot can not enter the system. I used to often forced shutdown, distressed computer for three minutes.