GNOME Bugzilla – Bug 579355
Avoid autorestart loops
Last modified: 2010-11-29 21:28:24 UTC
With session saving, what happens is that the vino-server gets saved into the session, and then the next time you log in, the vino-server from the saved session is already running when gnome-session tries to autostart it. That causes the autostarted vino-server to exit, because there is already one. Since the vino-server.desktop file has autorestart turned on, gnome-session promptly tries to start it again, and it goes away again, etc, etc. Here is a patch that I found in the Ubuntu package. It seems they forgot to upstream it, boo.
Created attachment 132853 [details] [review] patch
Hi, Matthias. There's something wrong here, as you can see, this patch doesn't apply.
Yeah, sorry. the patch is reversed. You can apply it with patch -R
I'm not familiar with session saving at all, so, if you have tested it and it worked, please, go ahead and commit it. BTH, this issue appeared recently, right? gnome-session wasn't saving sessions before? Ah, only the file vino-server.desktop.in.in needs to be patched ;) Thanks!
Right, the issue only appears now that gnome-session is saving session members. This causes two vino-servers to be started, and unfortunately, the one that comes last has an autorestart set, so it gets restarted in a loop.
Is this issue fixed in gnome-session? http://bugzilla.gnome.org/show_bug.cgi?id=575004 I think makes sense to fix this in gnome-session rather than in all auto-started programs.
It is not clear that there is a bug in gnome-session, really. Session saving was bolted onto the new design without working out these minor kinks :-(
There is a similar bug report on https://bugs.launchpad.net/bugs/340515, the change mentioned is specific to debian and not ubuntu
Created attachment 133604 [details] [review] Non-reversed patch I’m the one at fault since I forgot to forward the patch after adding it. Here is the version we actually use. I also don’t think it is a bug in gnome-session. Some autostart programs could benefit from session saving if they open windows and want the state to be remembered, so it’s up to programs not using it to not register with XSMP.
So, IMHO, this *is* a bug in gnome-session :-) We can detect that a saved app was first autostarted (and not started manually), in which case we should not start again the autostart app.
(In reply to comment #10) > We can detect that a saved app was first autostarted (and not started > manually), in which case we should not start again the autostart app. This would indeed be an improvement, but this will not fix this specific bug. If vino was enabled at some time and added to the session manager, disabling it will leave it in the session, and starting from that time the XSMP code will still start it.
Not necessarily. There should be the AutostartCondition key in the desktop file of the saved app, so we can use it.
Assigning to gnome-session then.
Saw this in OpenSolaris as well.
I just removed gnomeclient code in vino, i'm using eggsmclient now, just for catch the 'quit' signal. vino is not doing any saving-session stuff anymore. I think this bug is gone because of this, right?
(In reply to comment #15) > vino is not doing any saving-session stuff anymore. I think this bug is gone > because of this, right? Nope, the bug is not specific to vino, so it's still valid.
Let's keep this bug for the loop issue, and use bug 576633 for the autostart vs session saving issue.
c3e3ebdb1603757adcf1d8848d61037337741df5 fixes this, and bug 634762 talks about the UI that should be implemented.