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 706692 - add phase _EARLY_INITIALIZATION
add phase _EARLY_INITIALIZATION
Status: RESOLVED FIXED
Product: gnome-session
Classification: Core
Component: gnome-session
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Session Maintainers
Session Maintainers
Depends on:
Blocks: 704956
 
 
Reported: 2013-08-23 20:59 UTC by Alban Crequy
Modified: 2013-10-15 14:22 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
[PATCH 1/2] gnome-session/README: rename enum to match the code (2.86 KB, patch)
2013-08-23 21:00 UTC, Alban Crequy
committed Details | Review
[PATCH] add new phase: GSM_MANAGER_PHASE_EARLY_INITIALIZATION (7.12 KB, patch)
2013-08-23 21:03 UTC, Alban Crequy
committed Details | Review

Description Alban Crequy 2013-08-23 20:59:31 UTC
This would be useful for gnome-initial-setup bug #704956. Patches with rationale to follow.
Comment 1 Alban Crequy 2013-08-23 21:00:42 UTC
Created attachment 252956 [details] [review]
[PATCH 1/2] gnome-session/README: rename enum to match the code
Comment 2 Alban Crequy 2013-08-23 21:03:18 UTC
Created attachment 252957 [details] [review]
[PATCH] add new phase: GSM_MANAGER_PHASE_EARLY_INITIALIZATION

gnome-initial-setup-copy-worker and gnome-keyring (and others) used to be
started automatically by the session manager during the
GSM_MANAGER_PHASE_INITIALIZATION phase. This is racy because gnome-keyring
could read its file ~/.local/share/keyrings/login.keyring before it is written
by gnome-initial-setup-copy-worker. The correct solution is to wait
gnome-initial-setup-copy-worker finishes before starting other components in
the initialization phase.

I want to enforce this order without adding knowledge of gnome-initial-setup in
gnome-keyring and others. It must also work on systems which don't use
gnome-initial-setup. So I don't use a flag file in gnome-keyring's
AutostartCondition to delay its startup.

Instead, I add a new phase GSM_MANAGER_PHASE_EARLY_INITIALIZATION before the
initialization phase. If no autostart desktop files use that phase,
gnome-session will just go on to the next phase. But if
gnome-initial-setup-copy-worker uses this new phase, it will ensure
gnome-initial-setup-copy-worker finishes before the newly installed files in
$HOME are read by anyone.

Relevent documentation:
https://wiki.gnome.org/SessionManagement
http://standards.freedesktop.org/autostart-spec/autostart-spec-latest.html
http://lists.freedesktop.org/archives/xdg/2007-January/007436.html

https://bugzilla.gnome.org/show_bug.cgi?id=706692
Comment 3 Ray Strode [halfline] 2013-08-23 21:05:07 UTC
bug 706420 also adds a new phase.  we should make sure there's coordination between these two bugs.
Comment 4 Alban Crequy 2013-08-23 21:17:12 UTC
(In reply to comment #3)
> bug 706420 also adds a new phase.  we should make sure there's coordination
> between these two bugs.

Thanks, I was not aware of it. There is also #563642 about adding yet another phase.