[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#220675: xserver-common: Providing requested info

On Fri, Jun 11, 2004 at 12:39:16AM -0400, Adam Aube wrote:
> Yet when I add the checksum, I get the same result:
> /var/lib/dpkg/info# cat xserver-common.conffiles
> /etc/X11/xserver/SecurityPolicy
> /etc/X11/Xwrapper.config
> /var/lib/dpkg/info# md5sum /etc/X11/Xwrapper.config
> dd876d1ea24b7d78725699b82afb2c68  /etc/X11/Xwrapper.config
> /var/lib/dpkg/info# head -2 xserver-common.md5sums
> dd876d1ea24b7d78725699b82afb2c68  etc/X11/Xwrapper.config
> 5e63f298721bdd4062d3c66967df99ba  etc/X11/xserver/SecurityPolicy

That's not where you're supposed to add the checksum.  These aren't
conffiles, though they share the use of MD5 checksums to detect changes.

Please review the Debian X FAQ[1], which covers this information in
exhaustive detail.

*) How do the XFree86 packages manage their non-conffile configuration files
   like /etc/X11/X, /etc/X11/Xwrapper.config, and /etc/X11/XF86Config-4?

("Conffile" is a Debian term for a configuration file that is shipped as part
of a package's payload.  Non-conffile configuration files are either not
handled by the package system at all, or are created and removed by a
package's maintainer scripts.)

The method of non-conffile configuration file management that the Debian
XFree86 packages used from approximately version 4.0.1-9 to 4.2.1-9
unfortunately proved to be too confusing for many users to tolerate.

Each of these files has some corresponding state information in

The .md5sum files contain MD5 checksums, and the .roster files contain a list
of packages that might write a new version of the configuration file.

The Xwrapper.config and XF86Config-4 files' checksums are based upon their
file contents.  /etc/X11/X is a symbolic link, so its checksum is based on the
output of the "readlink" command when run against that file.  The checksums
are stored in /var/lib/xfree86, and use the basename of the corresponding
configuration file with the suffix ".md5sum".

The post-installation scripts of the xserver-common, xserver-xfree86, and
xserver-xfree86-dbg packages will not overwrite the aforementioned
non-conffile configuration files if *any* of the following conditions is met:
- the configuration file does not exist
- the configuration file's checksum file does not exist
- the configuration file's stored checksum does not match the one
  calculated when the post-installation script runs
If *none* of the foregoing conditions are met, the configuration file is
automatically updated, and if it has changed, its new MD5 checksum is written
to the appropriate location in /var/lib/xfree86.

The roster file is used simply to keep track of when it is safe to remove a
non-conffile configuration file on package purge.  As each package that is
listed in a configuration file's roster is purged, that package's name is
removed from the roster.  When the last package name is removed, one final
comparison between the configuration file's MD5 sum and the stored MD5
checksum is made, just as with the case when a configuration file is to be
overwritten.  If the same conditions are met under which the file would be
rewritten (it exists, the checksum file exists, etc.), the file is removed.
In any case, when the last package listed in a configuration file's roster is
removed, the stored checksum file is removed.  Therefore it is possible for a
modified configuration file to remain on the system after all packages
interested in potentially writing to it have been removed, and even their
roster and checksum files are gone.  This is regarded as the correct behavior
because, by modifying the configuration file, the user has expressed his or
her desire to have the packaging system abandon control of the file.

It is expected that the XFree86 3.x Debian packages will be updated to work as
above but as of this writing they retain the previous behavior, which attempts
to use debconf markers to ascertain whether the /etc/X11/XF86Config file has
been customized by the user.

People writing installers for the Debian OS should note that pre-configuration
of the XFree86 X server is now as simple as creating an /etc/X11/X symlink and
/etc/X11/XF86Config file before installing the xserver-xfree86 package.  The
presence of these files causes the question priority of the package's debconf
questions to be capped at "medium"; the files' existence is regarded as
defining a "reasonable default" to the debconf questions (see debconf(7)).
Therefore, setting the DEBIAN_PRIORITY environment variable to "high" will
bypass the asking of all X server-related debconf questions, and the existence
of the /etc/X11/X and /etc/X11/XF86Config-4 files in the absence of stored
checksum files will prevent them from being overwritten by maintainer scripts.

*) I've customized my /etc/X11/X, /etc/X11/Xwrapper.config, and/or
   /etc/X11/XF86Config-4 files so the packages don't automatically update them
   anymore.  I'd like them automatically managed again, though; how can I
   achieve that?

Please be aware that your local customizations will be *LOST* if you do this!
Don't say you weren't warned...

You can "trick" the packages into thinking that the versions of the
configuration files on disk were written by them by replacing the MD5 checksum
that they have associated with the file.  /etc/X11/X is a bit of a special
case because it is a symbolic link, not a file with contents.

For /etc/X11/X, do the following as root:

# readlink /etc/X11/X | md5sum > /var/lib/xfree86/X.md5sum
# dpkg-reconfigure xserver-xfree86

(You may have xserver-xfree86-dbg installed instead, in which case, run
dpkg-reconfigure on that package instead.)

For /etc/X11/XF86Config-4, do the following as root:

# md5sum /etc/X11/XF86Config-4 > /var/lib/xfree86/XF86Config-4.md5sum
# dpkg-reconfigure xserver-xfree86

(You may have xserver-xfree86-dbg installed instead, in which case, run
dpkg-reconfigure on that package instead.)

For /etc/X11/Xwrapper.config, do the following as root:

# md5sum /etc/X11/Xwrapper.config > /var/lib/xfree86/Xwrapper.config.md5sum
# dpkg-reconfigure xserver-common

Another way to accomplish the above is to purge the packages from your system
and reinstall them, but that can be considerably more disruptive.
Nevertheless, here's an example (like the commands above, it must be run as

# dpkg --purge xserver-common xserver-xfree86 xserver-xfree86-dbg
# apt-get install xserver-common xserver-xfree86 xserver-xfree86-dbg

Omit one or more of the package names in these commands if you only want to
use this method on some of the configuration files.  xserver-common deals with
/etc/X11/Xwrapper.config, and xserver-xfree86 and xserver-xfree86-dbg share
/etc/X11/X and /etc/X11/XF86Config-4.

> /var/lib/dpkg/info# export DEBUG_XFREE86_PACKAGE=YES
> /var/lib/dpkg/info# export DEBIAN_FRONTEND=readline
> /var/lib/dpkg/info# dpkg-reconfigure xserver-common
> [snip]
> xserver-common postinst note: not updating /etc/X11/Xwrapper.config; no
>    stored checksum available
> Where must I add the checksum so debconf recognizes it?

If you follow the instructions, does it work as expected?

[1] http://necrotic.deadbeast.net/xsf/XFree86/trunk/debian/local/FAQ

G. Branden Robinson                |     Religious bondage shackles and
Debian GNU/Linux                   |     debilitates the mind and unfits it
branden@debian.org                 |     for every noble enterprise.
http://people.debian.org/~branden/ |     -- James Madison

Attachment: signature.asc
Description: Digital signature

Reply to: