- Linux Mint Forums
- How to restart Cinnamon without closing running programs?
- How to restart Cinnamon without closing running programs?
- Re: How to restart Cinnamon without closing running programs
- Re: How to restart Cinnamon without closing running programs
- Re: How to restart Cinnamon without closing running programs
- Re: How to restart Cinnamon without closing running programs
- Re: How to restart Cinnamon without closing running programs
- Re: How to restart Cinnamon without closing running programs
- No clear way to restart Cinnamon from a tty #4763
- Comments
- bernd-wechner commented Oct 29, 2015
- glebihan commented Oct 29, 2015
- bernd-wechner commented Oct 30, 2015
- glebihan commented Oct 30, 2015
- bernd-wechner commented Oct 30, 2015
- gritty-gitty commented Nov 1, 2015
- glebihan commented Nov 1, 2015
- bernd-wechner commented Nov 1, 2015
- gritty-gitty commented Nov 2, 2015
- glebihan commented Nov 2, 2015
- bernd-wechner commented Nov 2, 2015
- glebihan commented Nov 2, 2015
- bernd-wechner commented Nov 2, 2015
- gritty-gitty commented Nov 2, 2015
- bernd-wechner commented Nov 2, 2015
- gritty-gitty commented Nov 3, 2015
Linux Mint Forums
Welcome to the Linux Mint forums!
How to restart Cinnamon without closing running programs?
How to restart Cinnamon without closing running programs?
Post by bernd.wechner » Mon Sep 14, 2015 6:52 am
Re: How to restart Cinnamon without closing running programs
Post by xenopeek » Mon Sep 14, 2015 11:38 am
Split from http://forums.linuxmint.com/viewtopic.php?f=208&t=93247. Don’t revive support topics older than 6 months; new questions deserve new topics. See the forum rules.
Didn’t Cinnamon inherit this from Gnome Shell? Press Alt+F2 to bring up the run dialog, type ‘r’ (single letter r), and press Enter. That should restart your Cinnamon session while preserving your running programs. At least that is how Gnome Shell handles it.
Re: How to restart Cinnamon without closing running programs
Post by Cosmo. » Mon Sep 14, 2015 11:51 am
I never have seen this problem. Create a new account to find out, if you can reproduce the problem.
Which version of Mint do you use (17 / 17.1 / 17.2)?
Re: How to restart Cinnamon without closing running programs
Post by MintBean » Mon Sep 14, 2015 4:57 pm
Re: How to restart Cinnamon without closing running programs
Post by bernd.wechner » Fri Oct 30, 2015 12:16 am
Apologies for not getting back sooner, I am using the latest so MINT 17.2 and Cinnamon 2.6.13.
I have since answered this question, and know how to restart Cinnamon without closing running programs but run into other problems in the process so openned:
I’m content that what should work is a simple:
cinnamon —replace —display=:0
from a tty, and it sort of does, but not quite. See the new thread for details.
Re: How to restart Cinnamon without closing running programs
Post by Cosmo. » Fri Oct 30, 2015 5:33 pm
Re: How to restart Cinnamon without closing running programs
Post by bernd.wechner » Fri Oct 30, 2015 9:02 pm
Well, I have since worked out why «cinnamon —replace —display=:0» wasn’t working. For some odd (and as usual undocumented or if so not easily findable documentation) this only works if the account logged in on display :0 issues the command not anyone else, no not even root! That solves the mysteries I had.
CTRL+ALT+ESC works when I try it now, very neat and clean. Whether it works next time Cinnamon hangs I will only be able to tell when that happens. I have experience degrees of freeze. Some where lots is frozen but it still responds to the mouse and keyboard, so I suppose this works, and frozen as all heck in a sense where no mouse or keyboard input registers any effect — it is in these cases that switching to a console tty and issuing a simple command to restrat it is what is needed, and is possible, it exists and is «cinnamon —replace —display=:0» which only has the following dreadful caveats:
- it must be issues by the same account as the Cinnamon session has logged in. Not anyone else, not even root or it will fail (cryptically at that)
- It relies on Cinnamon starting on display :0 which empirically seems to be reliable but is not a guarantee and it’s kludgy that there is not command free of this assumption or knowing the display. If in down the w command will show the display id
This is a a significant shortfall in the Cinnamon recovery suite in a sense to my mind. ideally of course it doesn’t freeze, but in reality it does and sometimes it can be restarted form the Xtermai and other times a tty is needed. In the latter case Cinnamon should really provide a tool that works free of the two caveats listed and easy to teach beginners. If I’m to roll out MINT+Cinnamon in my family I can show them how to switch to a tty and teach them a simple command (So I’ve saved this one-liner a as shell script named cr (for Cinnamon Restart) in /usr/local/bin) but the nonsense I have been through wills car them for life and have them back on Windows or iOS in a blink believe me. These are the user friendliness issues Linux and MINT+Cinnamon at the forefront of of efforts to be useable for transitioning folk from other OSs need to bear in mind.
Источник
No clear way to restart Cinnamon from a tty #4763
Comments
bernd-wechner commented Oct 29, 2015
Cinnamon freezes. That’s life.
But we have the beautiful ability to restart Cinnamon.
There’s the famous (though only uncovered by searching the internet) ALT+F2 then r.
But this (and similar methods) only work if some of Cinnamon is still alive and responding.
When it’s not I go to a tty by say pressing ALT+CTRL+F1, and find my system responsive. Conclusion it is Cinnamon, not LinuxMINT that is hung.
But what to do? How to restart Cinnamon.
It’s entirely not clear as evidence by the lengthy discussion here:
My favourite response to which was:
cinnammon —replace —clutter-display=:0 2> /dev/null &
And yet, here’s the crunch, I am testing this and can see:
- from a terminal window in Cinnamon, it works. All the windows go down and come up again and all is good (with a minor glitch, a Wine window that I can’t kill often appearing) but works.
- if I do it on tty1 with slick timing pressing Enter then ALT+CTRL+F8 I can never catch Cinnamon doing it. So I have to wait until it’s frozen again to actually test it, as I see no way of distinguishing between:
- It works but is so slick and fast there’s nothing to see
- It doesn’t work and Cinnamon is not restarted
- So I tried this: cinnammon —replace —clutter-display=:0 (i.e. I’m watching stderr now) and it reports this:
It’s definitely on :0 as w reports this:
My main point here though is that it should surely be a priority for Cinnamon to have a simple reliable command line to restart it. Without having to even know the X display, restart them all dammit, or report a list of them if more than one is found and have an option to choose one.
But above all, how about the command line options
—display
—clutter-display
—screen
actually get documented?
What do they mean? Where are some examples?
This is one of the nastiest issue I am having with Cinnamon. Freezes are fortuitously rare, but when they happen, knowing I could restart it without losing all my windows but not knowing how is a frustration indeed.
The text was updated successfully, but these errors were encountered:
glebihan commented Oct 29, 2015
Since cinnamon auto-respawns, the simplest way to restart it is simply to kill the existing instance (eg killall -9 cinnamon ).
Apart form that, you do need to know the display cinnamon is running on in order to be able to restart it.
The command I use is DISPLAY=:0 cinnamon —replace .
bernd-wechner commented Oct 30, 2015
Thanks for the prompt reply. Alas with all due respect not helping me much or speaking to the request.
The linked to askubuntu thread is full of that very suggestion and that’s all good though lends the though your summary is a little flawed, and should perhaps read: export DISPLAY=:0; cinnamon —replace as if I understand rightly DISPLAY= sets a shell variable and export DISPLAY= sets an environment variable, and you’d want a semicolon to separate the commands.
But that said, while this works fine for me in a Cinnamon terminal window from a tty it as described impossible to feel confident it is working and very likely it’s not (please reread mye xperience, in particular that the tty simply reports:
No protocol specified Window manager error: Unable to open X display :0
and my main issue which is filed is the complete lack of a user friendly simple way of doing this from a tty, not a specific solution that works for some folk, has been passed word of mouth generation to generation so to speak.
Because it does from time to time freeze, and it is possible to restart from a tty there should be a simple lucid documented and provided utility to do so without having to do on-line reserch try a load of different people’s ideas and end up with cryptic messages like No protocol specified with no help.
Therein lies the issue — though of course I am open to solving my specific problem, the issue with Cinnamon is the lack of a no-brainer method to do this for a novice I install MINT for say.
glebihan commented Oct 30, 2015
To come back to my original suggestion : my summary DISPLAY=:0 cinnamon —replace was correct.
You do not need to use export .
The way I suggested to do it applies the DISPLAY variable to the command that you put on the same line.
If when running that, you get the message No protocol specified Window manager error: Unable to open X display :0 then either you’re using the wrong display number or you’re running the command with the wrong user.
As for your other points : I understand what you mean but I don’t think switching to a tty is user friendly in the first place. A novice user would never think of doing that.
What needs to be fixed is the fact that cinnamon can freeze (and if you can provide any information as to when it happens, that’d be very helpful) and that seems to me like a much more important thing than providing easy commands to restart it from a tty.
bernd-wechner commented Oct 30, 2015
Thanks heaps for the clarification! Great learning re: command line syntax in bash.
I agree going to a tty is not very user friendly but it’s easy to teach anyone, I can teach my wife and kids that much, it’s a simple keystroke.
How can I possibly be using the wrong display number? How can I diagnose that? All I’ve learned so far is that **w _will list it and _w lists:
as to the wrong user yes, I’m root on the tty and bernd on the Cinnamon session and guess what, you hit the nail on the head! I owe you a grand favour. It now visibly works as I can enter your command, press return and switch back to tty8 and I can see it’s restarted.
This also works: cinnamon —replace —display=:0
That solves my immediate problem.
It does not to my mind close the issue which is:
- Inadequate documentation of the command line options for Cinnamon
- Lack of a clear simple way to do this.
My local workaround is to put that command line in a shell script in /usr/local/bin, and I call it cr fro Cinnamon Restart and that works and I can teach it to novices. Alas it relies on hardcoding :0 but as far as I can tell it reliably starts on :0 (are there are reasons it would not?)
It seems a design flaw to me, for:
- A system we know freezes from time to time (heck even Windows explorer does)
- A system we know we can restart without loss (windows still in place no lost data) from a tty
that there is no simple command like cinnamon restart
that simply works, including for the root user (never heard of something that worked on my user account and not for root, and I only logged on as root as part of me thought you’d need su priviledges to stop and start service .
Finally, I agree that the essential problem is freezes, but they may never been completely solved (as I said, even Windows explorer locks up occasionally as does Android, and I’m not an Apple customer but would be surprised if iOS didn’t occasionally lock up too — though by reputation, less often than Windows 😉
gritty-gitty commented Nov 1, 2015
@glebihan: Albeit Cinnamon is able to auto-respawn, the problem with all those freezes is that in such a case it does not, hence the need to go to a tty.
@bernd-wechner: And this need is absolute, as Cinnamon won’t accept any key presses other than the [Ctrl+Alt] combos directed to X. That is, you’ll have to deal with the command line anyway (this problem won’t go away anytime soon, for it’s been there since the beginnings of Cinnamon, and it seems to be tied to deeper layers of the DE 🙁 ).
By drawing on my own experiences, I consider safer killing Nemo as well, although this will close all file manager windows, of course. But for me, the freezes are clearly tied to mount or unmount operations, i.e. the file manager is frozen altogether. This complicates the matter a little, but to find out a user’s display is the easiest part therein:
glebihan commented Nov 1, 2015
@gritty-gitty : cinnamon does respawn when you kill it, even in the case of those freezes.
bernd-wechner commented Nov 1, 2015
Nice script, it should be with the standard distro! For all the reasons I mention above.
Been a long time since I awked ;-), but too lazy to think about it now, I confess to wondering how this would work if two sessions are running? I have started two cinnamon sessions before, a second on tty9 just to see if could be done — it works, tty8 is frozen and you start a new on on tty9, of course it’s at the login window and a virgin start not my goal so didn’t explore it more. And likely to be rare as hen’s teeth as scenarios go and not need coding for, but if the script were to be solid if it found more than one it should bomb listing them and asking to rerun with one as a an argument (easiest UI for it methinks). Just something a newb I’ve given MINT+Cinnamon can be taught to escape such a freeze.
I see this as a no brainer. If I’m trying to win people over from Windows to Linux, MINT+Cinnamon comes as the most recommended solution and I can see why. But if they then encounter these lock ups more frequently than on windows I’ll lose them. And they will probably, I do an many I ask do.
If I then show them an easy way to fix it (tty1 and run this command) , simple enough that a newb could do it there is an opportunity here that sales folk are well aware of, of turning a problem into an asset. Many will be impressed at the separation of church and state so to speak oops I mean of Cinnamon and Linux and that you restart Cinnamon and keep your windows! Beautiful. Turned disappointment into mild pleasure ;-).
I would personally love to know how the new Cinnamon, respawned hooks onto the windows of the old . and wonder if it’s possible to start a new sessions and suck windows over to it. A pure thought experiment. As I see it Firefox say is just a program running on Linux that has hooks to a window on an Xterm, can be asked to rehook to another window on another Xterm? — on another Xserver?
Perhaps asking too much, but curious of the innards of X.
gritty-gitty commented Nov 2, 2015
@glebihan: You’re right, of course 😉 I should modify my previous comment to “in such a case it does not well [auto-respawn]” — otherwise we wouldn’t have to replace it…
@bernd-wechner: If you use multiple sessions a lot, you should process the subshell that generates MY_DISPLAY further. But I wouldn’t, as Cinnamon becomes relatively unstable even when you change the user without closing the session of the old one.
The point is, the recovery from such freezes is not as smooth as it should be. For instance, the script above won’t work if you add any command that produces some graphical output before Cinnamon stabilizes — hence the timeouts and zenity waiting for user input above.
glebihan commented Nov 2, 2015
@gritty-gitty : my point is precisely that you do not need to replace it. When you kill cinnamon, it respawns, which is why I said that killing cinnamon is the easiest way to restart it.
bernd-wechner commented Nov 2, 2015
Oh I don’t use multiple sessions ever at the moment. I looked at starting a new one and how as an experiment when trying to diagnose why «cinnamon —replace —display=:0» was bombing with errors is all, and demonstrated thereby that I could do «cinnamon —replace —display=:1» on a new session and it worked fine . an incremental piece of evidence in the trail. Can’t say I’ve fully nailed it or understood it, but the issue on :0 was that this command will (oddly to my mind) only work if issued by the user logged into the cinnamon session you’re replacing, root can’t do it! It bombs. Utterly weird.
Re: killing it, alas that’s not specific enough as would need to know exactly which process/processes to kill. Further would love to understand the mechanisms of the respawn, how that happens. Doe upstart handle it for example? Or some other daemon?
glebihan commented Nov 2, 2015
@bernd-wechner : it’s very easy to know which process to kill.
As I said in my first answer, killall -9 cinnamon does the job.
As for the respawn, it’s nothing that complicated, there’s simply a wrapper around the cinnamon process, called cinnamon-launcher, which handles initially launching cinnamon and respawning it when it crashes.
bernd-wechner commented Nov 2, 2015
Sorry I wasn’t clear. I don’t like that at all alas. It’s worse even than the hardcoded assumption of :0 display in gritty-gitty’s excellent script! It makes the bold assumption that no unintended process is caught by killall, which is a utility I would never use lightly I admit.
Sure, I understand the risk is low, probably very low, that this would have any negative impacts, not least demonstrated by your affection for it. But I do find it dirty in a way, not clean.
And filed issue is, that cinnamon should in it’s suite of tools a clean simple tool for restarting it from a tty, much like gritty-gitty’s script (albeit ideally with some display detection and choosing smarts in the rare circumstances that more than one is found). I’m a fan of clean solutions I guess.
And part of my drive here, is the MINT+Cinnamon seem to be targetting an audience of possible conversions from Windows. That is what brought me to it anyhow and I seem to recall reading in an abundance of on-line blurbs. That being the case I’d like to try eventually rolling it out to my family. But issues like these lock ups are prohibitive still (I’ll lose them). And yet, a come back with a simple demonstration of fix (at present go to tty1 and issue a command and go back to tty8) they are likely to be impressed not lost. And by extension I think this scenario is probably a big one in the market of possible roll out.
gritty-gitty commented Nov 2, 2015
@bernd-wechner: Oh, the point is that the script does not make assumption of display :0, it just takes the first one which happens to be :0 mostly, but not necessarily…
@glebihan: Yes, the launcher respawns Cinnamon, but it doesn’t work out for me: if Cinnamon doesn’t get replaced, either it lands in its safe mode or it doesn’t relaunch properly 🙁
bernd-wechner commented Nov 2, 2015
Ooops, hadn’t read it that closely. Close though, it still a weeny bit sloppy in the case of multiple returns and should perhaps bail with a list and accept an argument to specify one. Use case for a multiple returns then is, it bails with list, and prints usage: cinnamon-restart [display-id, where display-id is one of: . which it found. ;-). Just an idea. I can code it myself and repost if I find time. Am squeezing posts in here between things right now. Maybe one evening.
I might also experiment with users . turns out this command bails cryptically if a user other than the logged in user (in the cinnamon session being replaced) runs it (with a No protocol specified Window manager error — like that means anything to me.
So the script could also find a way to determine the logged-in user on that display, and su to that username and see if that works. Would need to empirically confirm that user B su’ed to user A can replace user A’s cinnamon session. Pragmatically B would be root anyhow.
gritty-gitty commented Nov 3, 2015
@glebihan: I have to correct myself: when the timeout are large enough, there is really no need to replace Cinnamon. Thus I changed the restart script above accordingly 😉
Источник