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 594344 - Startup delayed by while ck-history run
Startup delayed by while ck-history run
Status: RESOLVED FIXED
Product: gdm
Classification: Core
Component: general
2.27.x
Other Linux
: Normal normal
: ---
Assigned To: GDM maintainers
GDM maintainers
Depends on:
Blocks:
 
 
Reported: 2009-09-07 04:30 UTC by Robert Ancell
Modified: 2010-06-17 00:08 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Cache the result of ck-history so startup is not delayed (4.31 KB, patch)
2009-09-07 05:52 UTC, Robert Ancell
none Details | Review

Description Robert Ancell 2009-09-07 04:30:51 UTC
As part of the user detection the simple greeter runs ck-history to decide what order to display the users.  This operation is expensive as it involves scanning log files (which can be gzipped) and does not take constant time (some systems maye have huge log files).

Reported in Ubuntu:
https://bugs.launchpad.net/ubuntu/+source/gdm/+bug/400863
Comment 1 Robert Ancell 2009-09-07 04:31:50 UTC
One user reports that ck-history can take up to 40s to run!
Comment 2 Robert Ancell 2009-09-07 05:52:13 UTC
Created attachment 142612 [details] [review]
Cache the result of ck-history so startup is not delayed
Comment 3 Brian Cameron 2009-09-08 18:51:55 UTC
Note that bug #565151 has a patch to cache dmrc settings and face images in /var/cache/gdm.  I'd think this would be a better place to store ck-history cache.  The cache is really system specific, not user specific since users can share the same $HOME directory across multiple systems.

Perhaps this patch should depend on that bug being addressed first, and also use /var/cache/gdm for the cache directory.
Comment 4 Robert Ancell 2009-09-10 02:50:18 UTC
The location of the cache in this patch is in the GDM users directory - this is because the greeter is being run by the GDM user.

Agreed the cache is not in the correct place, it should actually be in ConsoleKit. This patch is really a workaround for the current startup problem.
Comment 5 Brian Cameron 2009-09-10 02:52:25 UTC
I think putting it in /var/cache/gdm is a better place than the user's $HOME directory.  

But, it does seem to make sense to file a bug about ConsoleKit at bugs.freedesktop.org in the ConsoleKit category and see if it can be fixed there.
Has this been done?
Comment 6 Robert Ancell 2009-09-10 03:04:02 UTC
The cache is not in the users $HOME. It is in the GDM users home (in my case /var/lib/gdm).  This is because the greeter is not a root process - it is run by the GDM user.  The GDM user does not have access to /var/cache.

ConsoleKit doesn't have an interface to this information yet - GDM is getting via ck-history which is more of a diagnostic tool.
Comment 7 Robert Ancell 2009-09-10 03:06:19 UTC
See bug #593996 for the patch I am working on to make the user manager part of the GDM server (a root process).  In this case the cache would be in /var/cache.
Comment 8 Brian Cameron 2009-09-10 03:27:52 UTC
Sorry, I meant to say that /var/cache/gdm is a better place than the "gdm" user's $HOME directory.  But this is just my opinion.

I think bug #565151 will go upstream soon since it fixes a security issue (touching the $HOME directory before pam_setcred causes kerberos to break if the user's $HOME directory is automounted).

The patch for bug #565151 adds /var/cache/gdm with root:gdm ownership and 750 permissions.  However, it would be okay to change that to 770 permissions so the gdm user can read/write files to this directory if we wanted to support this sort of feature.
Comment 9 Ray Strode [halfline] 2009-10-13 18:58:27 UTC
We should definitely fix this at the consolekit level.  It's doing something that's very expensive, it should cache that on its own.
Comment 10 Brian Cameron 2009-12-15 20:53:55 UTC
I filed ConsoleKit bug #25660 about this issue, so it can hopefully get addressed:

  https://bugs.freedesktop.org/show_bug.cgi?id=25660
Comment 11 William Jon McCann 2010-06-17 00:08:30 UTC
In 2-30 and master this is all run async and with CK --since.  Should be good.