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

Re: XML as a standard UNIX config file format (Re: Caldera installation - something Debian should learn)



> Robin Stephenson wrote:
> >The disadvantage, of course, is that *every* program would have to be
> >ported to use XML as its config file format.
> 
> This is a disadvantage? I say let's dig in :)
> 
> UNIX *badly* needs a common config file format, and we might as well start
> now.
 
After reading the same Linux World article :-) I realized that the
conversion could be easily done in three steps:

1) write tools to convert the existing files into XML format.

2) write tools to convert the XML format back into existing format.

   (at this point system configuration tools would use the XML format)

3) modify existing services to use XML format as an alternative to
   the historical formats.

I have a program that will spin /etc/passwd, shadow, group, ftpusers,
fstab, inetd.conf, network, hostname, and a couple other files into an 
XML file, as a proof-of-concept of the idea.  The experience definitely
opened my eyes; I have no doubt that we *will* see XML replace the
existing formats.

However, I believe that there will be no 1:1 correspondence between
services and XML files.  A couple of examples:

USERS:

The user database is spread across /etc/passwords, groups, ftpusers,
securetty, and undoubtably other files.  Consider:

  <user name="root" uid=0 home="/root">
     <disallow_ftp>
     <disallow_telnet>
     <allowed_terminals>
     	/dev/console
        /dev/tty0
     </allow_terminals>
  </user>
        

FILES

  <disk device="/dev/hda">
     <partition id=1 format="ext2" first_cylinder=0 last_cylinder=100
        mountpoint="/" backup=1>
     <partition id=2 format="ext2" first_cylinder=101 last_cylinder=200
        mountpoint="/usr" backup=1 readonly>
  </disk>

  <exported_files>
     <directory mountpoint="/home/smith">
        <nfs>
           <export readwrite network="192.168.2.0/24">
           <export readonly network="192.168.0.0/16">
        </nfs>
        <samba domain="fooware" ignorecase>
        <coda options="xyz">
     </directory>
  <exported_files>

  <imported files>
     <nfs host="simple.example.com" partition="/home/debian" 
         mountpoint="/home/debian">
  </imported files> 
 
Obviously these XML examples cross numerous configuration files... and
they're *far* obvious than the current setup.  All information about
a user (except passwords) would be stored somewhere under the <user>
tag.  All information about a physical disk partition (partitioning
information, fstab info, etc.) would be stored at a single place.  etc.
  
Not shown is the idea of adding a tag for "host".  This would allow a
site to have a single master copy of the XML files and each system would
have an identical copy.  Where a "host" tag is listed the system would
only accept material specific to itself.  (Or its network, if a netmask
is specified.)

This is as far as I got since it was obvious that the proper implemention
would involve a lot more than slapping together some XML.
  
Bear Giles
bgiles@coyotesong.com 
> And, I daresay, 


Reply to: