After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 579355 - Avoid autorestart loops
Avoid autorestart loops
Status: RESOLVED FIXED
Product: gnome-session
Classification: Core
Component: general
2.26.x
Other Linux
: Normal normal
: ---
Assigned To: Session Maintainers
Session Maintainers
Depends on:
Blocks:
 
 
Reported: 2009-04-17 21:54 UTC by Matthias Clasen
Modified: 2010-11-29 21:28 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch (1.04 KB, patch)
2009-04-17 21:54 UTC, Matthias Clasen
accepted-commit_now Details | Review
Non-reversed patch (395 bytes, patch)
2009-04-29 20:15 UTC, Josselin Mouette
none Details | Review

Description Matthias Clasen 2009-04-17 21:54:31 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.
Comment 1 Matthias Clasen 2009-04-17 21:54:58 UTC
Created attachment 132853 [details] [review]
patch
Comment 2 Jonh Wendell 2009-04-18 00:01:14 UTC
Hi, Matthias. There's something wrong here, as you can see, this patch doesn't apply.
Comment 3 Matthias Clasen 2009-04-18 03:02:08 UTC
Yeah, sorry. the patch is reversed. You can apply it with patch -R
Comment 4 Jonh Wendell 2009-04-18 13:40:16 UTC
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!
Comment 5 Matthias Clasen 2009-04-18 17:15:49 UTC
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.
Comment 6 Jonh Wendell 2009-04-20 11:43:38 UTC
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.
Comment 7 Matthias Clasen 2009-04-20 13:46:30 UTC
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 :-(
Comment 8 Sebastien Bacher 2009-04-21 16:37:52 UTC
There is a similar bug report on https://bugs.launchpad.net/bugs/340515, the change mentioned is specific to debian and not ubuntu
Comment 9 Josselin Mouette 2009-04-29 20:15:12 UTC
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.
Comment 10 Vincent Untz 2009-04-30 16:27:14 UTC
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.
Comment 11 Josselin Mouette 2009-05-02 06:49:35 UTC
(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.
Comment 12 Vincent Untz 2009-05-02 07:06:53 UTC
Not necessarily. There should be the AutostartCondition key in the desktop file of the saved app, so we can use it.
Comment 13 Jonh Wendell 2009-05-12 14:10:47 UTC
Assigning to gnome-session then.
Comment 14 Ghee Teo 2009-05-15 16:09:51 UTC
Saw this in OpenSolaris as well.
Comment 15 Jonh Wendell 2009-06-20 01:04:32 UTC
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?
Comment 16 Vincent Untz 2009-06-20 01:10:03 UTC
(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.
Comment 17 Vincent Untz 2009-09-01 14:47:53 UTC
Let's keep this bug for the loop issue, and use bug 576633 for the autostart vs session saving issue.
Comment 18 Vincent Untz 2010-11-29 21:28:24 UTC
c3e3ebdb1603757adcf1d8848d61037337741df5 fixes this, and bug 634762 talks about the UI that should be implemented.