id,summary,reporter,owner,description,type,status,priority,milestone,component,resolution,keywords,cc,fix_version,see_also 778,Do not use dpkg-query in Xsession.d scripts,broder,jdreed,"Right now, several of the scripts in /etc/X11/Xsession.d use `dpkg-query -W -f '${Status}' PACKAGE` to test if a package is installed. This is necessary because conffiles are not removed when a package is uninstalled (only when it's purged), and Debian Policy dictates that a conffile cause no change when the package is uninstalled (it's only kept so that the configuration can be restored should the package be installed in the future). However, using dpkg-query requires loading the entire dpkg database into buffer cache, which is a slow process, at least the first time, and happens at a point where there's already lots of disk I/O happening. Looking at bootcharts, it generally takes about 2 seconds. Because that query has to finish before the script can determine whether to do anything, it blocks the login time. Instead of using dpkg-query, all of those scripts should be changed to use a finer-grained test. For instance, the debathena-larvnet script could check for `[ -x /usr/lib/debathena-larvnet/larvnet-wrapper ]`, which is much less filesystem-intensive.",enhancement,closed,normal,The Distant Future,login chroot,fixed,,,,