78

I installed Cinnamon on my Ubuntu 12.04, and it works well, but sometimes it just freezes for no reason. I can move my mouse but can't click on anything.

So I want to restart Cinnamon from tty, like I used to do with gnome shell. How do I do that?

I tried killall cinnamon and nothing happened.

Then I tried export DISPLAY=:0.0 , cinnamon --replace and still nothing.

I guess the command cinnamon is not valid. I don't want to restart the whole X server because then all of my windows will get closed. I just want to restart the window manager cause I believe it is causing the problem.

16 Answers 16

123

Hit Alt+F2, type r and hit enter.

  • This is the correct answer. Worked for me (Deb.7) – Stichoza Jan 8 '14 at 23:38
  • 9
    In my case, Cinnamon is completely frozen and doesn't respond to Alt+F2. – levesque Mar 29 '14 at 22:09
  • 41
    this is simply wrong since the question is "[...] from the tty?" – Lucas Jun 1 '14 at 22:33
  • 5
    I completely agree with @Lucas here, but I'll hold off on voting it down just because it's a very useful shortcut to know, even if not from the tty as the OP describes. It might conceivably work while cinnamon is not properly functional though? – mc0e Nov 9 '15 at 15:00
  • 1
    @kmarsh An update should solve that. Works on Mint 18 Cinnamon – and saves me from installing an extra applet just for that rarely used functionality. As some applets require a Cinnamon restart after being installed, it's indeed a very useful shortcut – though I fully agree it's not the answer the OP was after. First hit on a Google search for "restart Cinnamon", so +1 and let it stay :) – Izzy Nov 10 '16 at 19:43
52

The cinnamon --replace process can be sent the HUP signal which will trigger it to restart, thus preserving your open window and running applications.

$ pkill -HUP -f "cinnamon --replace"

This will take care to send the HUP signal to a process that matches the pattern, "cinnamon --replace". The signal HUP (SIGHUP) tells the process to "Hang Up".

  • 1
    This is first solution that's worked for me with no nasty side effects. For those who don't know.. if you can't start the terminal, press Alt+F2 to get to a TTY, login with an admin-capable account, become root, and then enter that command. You might have to Alt+F[n] to get back to your X TTY. – aggregate1166877 Feb 18 '15 at 14:18
  • What is the cinnamon --replace process doing? – Seanny123 Dec 9 '16 at 0:47
  • @Seanny123 - restarts cinnamon but replaces the current one with a new one. – slm Dec 9 '16 at 0:52
  • ah, so the process go stuck trying to replace the existing cinnamon instance, which was causing the freeze, which is why I needed to kill it? – Seanny123 Dec 9 '16 at 1:01
  • @Seanny123 - cinnamon is hung up, the replace triggers a restart but leaves all the subsequent "child" bits alone. – slm Dec 9 '16 at 1:02
51

This happens to me a lot, too, and this thread is one of the top results when googling for "restart cinnamon". Unfortunately, the instructions don't work for me (only because the display number is wrong!). For future visitors, here's what I do that always helps me.

  1. Cinnamon freezes
  2. Switch tty. I usually go to tty6, Ctrl+Alt+F6
  3. If you need to login first, do so.
  4. Type w (yes, just the letter) and press enter. This commands does a lot of different things, but you need it to figure out the number of the display you are using. The display number is in the column FROM. Mine is :0 (yes, including the colon).
  5. Assuming that cinnamon is already dead (which you would notice by the windows lacking titles and that you can't move different windows around, and perhaps even not being able to use the keyboard), you type export DISPLAY=:0; cinnamon &, and don't forget the colon. I add the ampersand (&) only not to keep that tty busy.

This always works for me, and I don't lose open windows. Also, I keep these instructions in a file called restartcinnamon, which is just a text file. I keep the file in my Dropbox folder, so no matter what machine I am on I can just type cat ~/Dropbox/restartcinnamon if I need to be reminded of how to do it.

  • After doing this, my 3 screens (3 monitors) become like one. Any advice? – justingordon Jan 23 '13 at 23:31
  • The fix then is to open up the displays panel and then click OK. Any way around this? Multi-monitor support has always been flakey on Linux. – justingordon Jan 23 '13 at 23:44
  • 1
    Also worth noting: the TTY doesn't take the current Num-lock state. Had some confusing time figuring out why my password was incorrect... – Richard de Wit Jul 21 '14 at 21:42
  • The above worked (thanks!). I use 2 monitors, I disable my laptop and use the main monitor with "disper -S", after the cinnamon restart I had a black screen. I used "disper -s" (note lowercase s here, meaning primary screen) to switch back to the laptop display and...the main monitor came on instead. If anyone is using disper, maybe try the big-S and little-s variants? I use Synapse so I just typed Ctrl-Shift-Space (my hotkey) and then "disper -S" – Ian Ozsvald Jun 18 '15 at 9:11
22

The easiest sulution would be:

killall -HUP cinnamon
  • 1
    Worked for me perfectly. – Luca Steeb Sep 1 '15 at 18:19
  • This logged me out from the existing Cinnamon session, though. – musiphil Dec 11 '17 at 21:12
  • Cinnamon sometimes freezes on my system. When I try this (in console mode, Ctrl+Alt+F1, works even with frozen Cinnamon) and then return back to normal (Ctrl+Alt+F7), Cinnamon shows an error message saying that it crashed. I can then click "yes" to restart it (if I click "no", I failed and need to restart) and everything works like normal again. Only windows that were inverted with the "press Win+I to invert windows" extension are no longer inverted. Tested with Cinnamon 3.2.7 on Debian 9.11. – Fabian Röling yesterday
12

Cinnamon has a direct keyboard-shortcut to restart the desktop without restarting any of the running applications:

ctrl+alt+esc

Which will probably still work in some cases when the alt+f2 Method does not work anymory

  • 4
    Yes, this is what I want! – chaosink Jan 2 at 17:21
11

You can restart Cinnamon by:

  1. pressing Alt+F2, type r, and press Enter,

  2. Ctrl+Alt+Backspace (restart Xorg),

  3. in TTY use command: sudo service mdm restart

9

When you kill cinnamon, check if it hasn't stopped writing killall cinna and pressing Tab. If the rest of the word appears, make it die with killall -9 cinnamon, and then restart it, using what you tried but without --replace:

export DISPLAY=:0.0; cinnamon
2

The following combination of the above comments worked for me:

  1. Ctrl-Alt F1 to switch to terminal 1. Log in if necessary
  2. $ w (yes, single letter "w" is a command) to see your display # in the FROM column). For me it was :0 (includes the colon). Also, the TTY column will have the terminal # of your cinnammon session (for me it was tty8).
  3. $ cinnammon --replace --clutter-display=:0 2> /dev/null &

    Notes on this last command:

    • :0 was my display #.
    • & returns control of the terminal
    • the --clutter-display, if not entered, uses the DISPLAY, variable, which is why some of the prior suggestions did EXPORT first. But you can just pass the argument directly to cinnamon. See cinnamon --help for more.
    • 2> /dev/null redirects stderr to nowhere so my terminal does not get cluttered with messages.
  4. Ctrl-Alt-F8 to return to my window cinnamon environment (F8 for me since my terminal was tty8 per the w command above. For you it may not be F8.)

Net result: this restarted cinnamon in my terminal (tty8) without losing my windows.

2

try this

  1. pressing Ctrl + Alt + F2
  2. export DISPLAY=:0.0; cinnamon --replace
  • 1
    -1 The question says very clearly that this didn't work. – David Foerster Jul 20 '16 at 11:01
1

You can try the w -ous command and check if there is number for DISPLAY. If there isn't a number just use startx and Alt+F7 to go back to GUI.

1

After you have switched to tty Try this killall -HUP cinnamon. Press Ctrl + Alt + F7. Cinnamon will ask you if you want to restart cinnamon.

1

I have this problem periodicaly due to gfx driver for HP Envy.

I need to do one or both of the following depending on the circumstancel;

  1. As the top answer, and others, suggest - restart cinnamon - Press ALT + F2, press R, and then hit ENTER. (Do this if the taskbar becomes unresponsive, or windows do not actually have focus, on-click etc. eg, you may be clicking or typing in the window that seems to have focus, but the one behind is receiving the event - this can even he hidden completely behind the window you THINK is active)
  2. Switch to a virtual console, then back to X - Press CTRL + ALT + F1, to go to the console, then press ALT + F8 to return back to X. - (Do this if the WHOLE screen is unresponsive - at least you don't SEE anything happening - this fixes things for me at least.)

This problem exists for me still - Linux Mint 17.x - hope it helps!

1

I sometimes have that problem when locking the screen: the lock screen doesn't appear and my system seems frozen, with no input working, and I can't log back in.

My solution is to kill the cinnamon-screensaver process.

% pkill cinnamon-screen

pkill uses the info in /proc/PID/stat, and Linux only stores the first 15 characters of the command name, so using "pkill cinnamon-screensaver" won't work.

Now my system is unlocked, input works again and I have not lost any of my windows. To make the system lockable again, I restart the screensaver.

% nohup cinnamon-screensaver > /dev/null 2>&1 &

I redirect to /dev/null to avoid the creation of the nohup.out file.

  • Thanks a ton!! All the expert answers above failed miserably. This solution works on my high configuration system installed with AMD Ryzen Threadripper CPU and Ubuntu 18.04. – Loves Probability Aug 9 '18 at 1:30
0

Try to "soft-restart" cinnamon by sudo kill -USR1 <PID of your cinnamon process>. @Daniel's answer is correct but will kill X server while SIGUSR1 won't, at least on my machine... It turns out, as well, that all the windows preserve content and remain usable after that. Wondering if this is true for the others.

0

I tried Ctrl+Alt+Backspace (Kill x server),

That seemed to work for me. (However I had started a second cinnamon session (cinnamon &) doing so caused only the wallpapaer to be shown. I then did the Kill x server keystroke. That appeared to restarted the remaining cinnamon shell, and killed it again, I think thats how I got back to normal. It did the login zoom to desktop thing, so I was satisfied at that point; (LM 17.1 Rebecca))

0

I've tried all previous solutions, but none of them works. The solution that works for me is killall cinnamon-session Hope this helps. P/s: My linuxmint version is cinnamon 18.3

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.