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 576633 - Session saving & autostarted applications
Session saving & autostarted applications
Status: RESOLVED OBSOLETE
Product: gnome-session
Classification: Core
Component: gnome-session
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Session Maintainers
Session Maintainers
Depends on:
Blocks:
 
 
Reported: 2009-03-25 00:46 UTC by Vincent Untz
Modified: 2021-06-14 18:20 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Vincent Untz 2009-03-25 00:46:36 UTC
From bug 552387 comment 93:

===============
the gnome-session save does not get filtered properly. I have an applet which
has
Exec=/usr/lib/ospm/ospm-applet which after a couple login/logout, 3 copies of
it is running including the copy from /usr/share/gnome/autostart directory,
 ptree | grep ospm-appl
              6629  /usr/lib/ospm/ospm-applet --sm-config-prefix /ospm-applet-X
              6656  /usr/lib/ospm/ospm-applet --sm-config-prefix /ospm-applet-S
              6659  /usr/lib/ospm/ospm-applet

in $HOME/.gnome2/gnome-session/saved-session
grep ospm *
10dfa650007ebba0f5123662105892043300000060280001.desktop:Name=ospm-applet
10dfa650007ebba0f5123662105892043300000060280001.desktop:Exec=/usr/lib/ospm/ospm-applet
--sm-config-prefix /ospm-applet-SzaW3l/ --sm-client-id
10dfa650007ebba0f5123662105892043300000060280001 --screen 0
10ff35230049e0bdd5123662098169630600000057720001.desktop:Name=ospm-applet
10ff35230049e0bdd5123662098169630600000057720001.desktop:Exec=/usr/lib/ospm/ospm-applet
--sm-config-prefix /ospm-applet-Xza40l/ --sm-client-id
10ff35230049e0bdd5123662098169630600000057720001 --screen 0

It shows the two desktop files and hence 3 copies of the applet is running.

Is that a bug or is there some desktop file attributes that needs to be set?
===============
Comment 1 Vincent Untz 2009-03-25 00:49:43 UTC
That's actually a tough thing to handle correctly for the session manager. I would think the conclusion here is that if an app is expected to be autostarted, it should either:

 + not be saved in the session
 + set a X-GNOME-Provides key in its desktop file to something unique (this way, the saved client will mask the one from the autostart dir on next login)

If we don't do this, then we'll end up with two instances of the application on next login, and possibly three instances on the next one, etc.

So I propose that we don't save autostarted applications unless they have a X-GNOME-Provides key in their desktop file. Looking at the list of autostarted apps here, I don't feel like any of them should be saved anyway.

Opinions?
Comment 2 Jeremy Nickurak 2009-03-25 00:59:35 UTC
How would this play along with XSMP apps that request to be in the session on login?
Comment 3 Vincent Untz 2009-03-25 01:03:50 UTC
(In reply to comment #2)
> How would this play along with XSMP apps that request to be in the session on
> login?

Not sure what you mean: it seems to me that you're talking about XSMP apps that would be saved during session saving. That's what the bug is about: if the XSMP app is in the saved session and in an autostart dir, we don't want to launch it twice.
Comment 4 Dan Winship 2009-03-25 02:13:24 UTC
gnome-session 2.22 just compared autostart Exec lines and XSMP RestartCommands to figure out which ones were dups, and that seemed to work well enough. Bug 341286 has relevant discussion/patches (coming from the opposite direction, because the original version of the code removed too many duplicates, rather than too few like 2.26 does).

For a more rigorously correct solution, gnome-session could figure out at session-save time which XSMP clients correspond to autostarted apps, and adjust the information in the session file accordingly. For autostarted apps that support X-GNOME-Autostart-Notify, gnome-session should already know that information. http://live.gnome.org/SessionManagement/NewGnomeSession has some ideas on making this work with non-X-GNOME-Autostart-Notify apps too.
Comment 5 Ghee Teo 2009-03-25 09:16:03 UTC
I couldn't tell whether the duplication is caused by the comparison of the program name against the full path in the desktop file. Note that example has prefix in /usr/lib/ospm, where as when I printed some of the property name which is simple a program name without full path. So comparison may be invalid.

Comment 6 André Klapper 2021-06-14 18:20:51 UTC
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org.
As part of that, we are mass-closing older open tickets in bugzilla.gnome.org
which have not seen updates for a longer time (resources are unfortunately
quite limited so not every ticket can get handled).

If you can still reproduce the situation described in this ticket in a recent
and supported software version of gnome-session, then please follow
  https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines
and create a new ticket at
  https://gitlab.gnome.org/GNOME/gnome-session/-/issues/

Thank you for your understanding and your help.