GNOME Bugzilla – Bug 594344
Startup delayed by while ck-history run
Last modified: 2010-06-17 00:08:30 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
One user reports that ck-history can take up to 40s to run!
Created attachment 142612 [details] [review] Cache the result of ck-history so startup is not delayed
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.
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.
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?
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.
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.
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.
We should definitely fix this at the consolekit level. It's doing something that's very expensive, it should cache that on its own.
I filed ConsoleKit bug #25660 about this issue, so it can hopefully get addressed: https://bugs.freedesktop.org/show_bug.cgi?id=25660
In 2-30 and master this is all run async and with CK --since. Should be good.