Configuration Files

I’ve been playing more with cisco and Solaris lately.  One thing that I really like is how the configurations are created.  Take Solaris zones for example.  There is a zoncfg app that gives a prompt where settings can be added an removed easily.  The online help makes it easy to figure out even what the most obscure parameters are.  This is especially apparent with Cisco hardware.  A simple “?” gives every single option available.  There is no looking through man pages for really obscure stuff.  It is simply right in front of you.

It would be easy to implement this sort of configuration for other applications.  Let’s make a make believe program called config.  Config would have the following requirements:

All configuration files would have to be written as the same type of file.  For example XML.

Each program that is to work with config would have a definition file.  This file would have all parameters, objects, and help documentation defined.  The parameters would be in a hierarchy.  For example, ip address would be a parameter under network.  Let’s say these file has a .confdef extension and resides under /etc/confdef.  This file is where most of the magic would be.  GUI clients could be easily created to use this file.
conf would be able to modify multiple parameter types.  For example a boolean or a string.  Booleans could be modified through an enable or disable command.  Strings could be set through set and unset commands.

There would be a verify command in config that would make sure nothing was missing and report what was missing.  If mac_address is required, you will be notified.

Revision control would be built in.  One could create and restore backups easily.

Could you imagine if all of Unix took on the task of a SINGLE configuration format?  People who say unix is difficult may have to think a little before they speek.

Here’s how I imagine it.

config xorg
config xorg>configure display
config xorg:display>set resolution ?
possible completions are the screen resolution eg 1024×800
config xorg:display>set resolution=1024×800
config xorg:display>end
must set a default color bits (bpp) value
config xorg:display>set bpp=24
config xorg:display>end
config xorg>configure extensions
config xorg:extensions>enable aiglx
config xorg:extensions>enable dri
config xorg:extensions>configure dri
config xorg:extensions:dri>set mode=0666
config xorg:extensions:dri>end
config xorg:extensions>end
config xorg>save
Version Apr 13 15:20 for xorg configuration saved please type extra comments below
-> Enabled AIGLX and DRI.  Set resolution to 1024×800.
The line above is automatically generated ^D
config xorg>commit
Version Apr 13 15:20 is now active configuration for xorg
Utopia right?

Related posts:

Tags: