Subject: Config files and paths for next XFree86 version
To: None <current-users@netbsd.org>
From: Matthieu Herrb <matthieu@laas.fr>
List: current-users
Date: 04/27/1999 21:57:13
Appended below is a proposition of David Dawes about configuration and
run-time generated files paths changes for the future XFree86 versions.

What do you think ? Do you have objections against /etc/X11
for configuration files ?

					Matthieu

There has already been some talk of making some changes to the search
path for locating config files, and about providing a safe way of allowing
users to select from multiple sysadmin-provided config files from the
command line.  While we're looking at this, we should also revise
the other use of directory paths, and make sure that they are consistent
with the "standards" for the various OS platforms.

1. Config file search path

  The current config file search sequence is:

    -xf86config command line option               (root only)
    $XF86CONFIG                                   (root only)
    $HOME/XF86Config                              (root only)
    /etc/XF86Config
    <ProjectRoot>/lib/X11/XF86Config.<hostname>
    <ProjectRoot>/lib/X11/XF86Config

  (We always define <ProjectRoot> to be "/usr/X11R6".)


  We're proposing to change that to:

    -xf86config [pathname/]filename               (root only)
    -xf86config filename (*)                      (non-root users)
    $XF86CONFIG                                   (root only)
    $HOME/XF86Config                              (root only)
    /etc/X11/XF86Config
    /etc/XF86Config
    <ProjectRoot>/etc/X11/XF86Config.<hostname>
    <ProjectRoot>/etc/X11/XF86Config
    <ProjectRoot>/lib/X11/XF86Config.<hostname>
    <ProjectRoot>/lib/X11/XF86Config

  (*) the search path for file names provided with the -xf86config option
  by non-root users would be:

    /etc/X11/<filename>
    <ProjectRoot>/etc/X11/<filename>.<hostname>            (maybe?)
    <ProjectRoot>/etc/X11/<filename>

  and "filename" is not allowed to contain any directory separators.

  The reasoning behind these choices is:

    - compatibility with old locations
    - compatibility with the /etc/X11 location that some (all?) Linux
      distributions use (and which is part of the Linux filesystem
      standard?), but which our code does not currently use.
    - The "etc/X11" locations provide a suitable place to isolate the set
      of files that the root-priviledged server can open at the user's
      direction.
 
  Possible problems:

    - more choices may mean more complexity/confusion, although the X server
      does show which file it reads.
    - The /etc/X11 location (and, in fact the use of any location outside of
      /usr/X11R6) may not be acceptable to some OSs.

  Possible variations:

    - remove the $XF86CONFIG and/or $HOME/XF86Config cases for root users.
      The reason for that would be to minimise the difference in uid-specific
      automatic behaviour.


2. Runtime-generated files used by various utilities.

  This includes xdm, xfs, X server (via xkbcomp).  Some examples:

     - xdm creates a log file (xdm-errors) that by default is located in
       <ProjectRoot>/lib/X11/xdm/.  A more natural place on most modern OSs
       is /var/log/.  Similarly for the xdm-pid file, which is more
       naturally located in /var/run/.  Also, the authorisation files (where
       should they be located)?

     - The X server creates a compiled xkb keymap (by running xkbcomp).
       The file is written to <ProjectRoot>/lib/X11/xkb/compiled/ when
       the server is started by root, and /var/tmp otherwise.  A more natural
       location for the root case might be /var/run/ or maybe /var/db/?

  Note: As of X11R6.4, <ProjectRoot>/lib/X11/xdm and <ProjectRoot>/lib/X11/xkb
  are actually symbolic links to /var/X11/xdm and /var/X11/xkb.  This leads
  to the next point ...


3. Host-specific config files when sharing <ProjectRoot> between multiple
   hosts.

  The introduction of /var/X11 in R6.4 (which was also in use before
  then by some OSs) is a way of dealing with two problems: having read-only
  <ProjectRoot>, and sharing a <ProjectRoot> between multiple hosts.
  The question is, should config files be located in /var?  As mentioned
  above, there are already natural places for most/all of the runtime-created
  files.

  Some examples of existing usage:

    - Digital Unix (4.0) puts all config and runtime-generated files under
      /var/X11, and has symlinks to them from the traditional <ProjectRoot>
      location.  This is the same as the R6.4 implementation.  Note that the
      X server config file is located in /var/X11 too.

    - CDE (on Solaris 2.6 at least) uses /etc/dt for optional host-specific
      config file customisations, and /var/dt for runtime-generated files.
      No symlinks are used for any of this.  /etc/dt is searched before the
      default /usr/dt locations, and runtime-generated files go directly
      in /var/dt.


  Possible options:

    - Leave things as-is, using /var/X11 approach like Digital Unix and R6.4.
    - Eliminate /var/X11, move host-specific config files to /etc/X11
      (like /etc/X11/xdm, etc), and put runtime-generated files in the
      OS-default locations.