Ubuntu – Restart Unity Without Logging Out

restartunity

I've used the command

unity

to restart Unity without logging out, but recently that's been also logging me out. I've also tried using

unity --replace

but that does the same thing. Can someone either help me get that command working correctly again or tell me another way to restart Unity while still keeping my current session?

If I try

sudo service lightdm restart

my screen goes black, and I just end up restarting my machine entirely.

Best Answer

I believe this is intended behavior. The Display manager (in this case, lightdm) creates and manages the login/x session. When you restart the display manager, you kill the x session and the currently logged in session and must log back in and establish a new session.

Someone more knowledgeable correct me if I'm wrong, but I believe this is the case.