Shutdown / restart does not complete [closed]

Solution 1:

Try running "xlsclients -a" (or "xlsclients -la" for more detail). The output is a little cryptic so you might consider installed a useful utility called wmctrl:

sudo apt-get install wmctrl

You can then run "wmctrl -lv" which will list the graphical apps running. What's nice about wmctrl is that the output includes the title of each graphical app so for example a firefox process might show up as "Ask Ubuntu - Stack Exchange - Mozilla Firefox".

The hex value included in the first column of the wmctrl output is the window ID. This can be used to kill an application using the standard xkill command which will look up the process id corresponding to the window ID and kill it. For example:

  xkill -id 0x024000e9