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

Re: Configuration (File) System



On Thu, 2004-03-18 at 01:48, Jens Hermans wrote:
> Currently I'm working on a technology to be able to represent
> configuration files as filesystems. The whole thing is outlined at
> http://users.pandora.be/paranet/CFS.htm , but I'll try to sumarize it
> shortly in here. (Note: the source is not online, I'll try to upload it
> someday near to developer.berlios.de , project CFS)
> 
> Basic concept of the whole thing is that you can mount for example your
> apache config as a filesystem and then be able to edit your config just
> by using FS functions (open/read/write/..). The configs will be parsed
> and converted into a directory structure, in which files represent
> single configuration parameters. Comments & whitespacing will off course
> be preserved, to prevent cluttering up your custom config too much.
> (more details, visit the above url)
> 
> I think this could be an interesting technology to use in combination
> with debconf, eg. get rid of all those "search & replace in config file"
> configurations that are used atm. 
> 
> I welcome all your comments, thoughts and participation on cfs.

I have a very similar idea, see
http://advogato.org/person/oku/diary.html?start=4

I did not think about a filesystem in first place, though, although it
should be possible as a future addition. But I want to represent the
structure of a conf file as a tree, very similar to a filesystem. Also,
do keep the parsers easy, I try to preserve as much of the structure of
a conf file as possible, it is then the task of an app that uses it to
find the correct entries. See the example for /e/n/i on the link above.
Also, very important for me is that the parser does not have to
understand each single option, so that future versions will (mostly)
work, and that comments are preserved. I have extra nodes ".comment",
".empty", and ".unparsed".

Many configuration files use similar syntaxes, so parsers can be shared.
Eg. /etc/fstab and /etc/hosts are just tables, if you tell the parser
the titles of the coloumns, you can use the same parser.

So far, I have written parsers for /etc/network/interfaces, simple shell
scripts that just assign values, tables and key/values pairs (eg.
/etc/resolv.conf).

I will put the code only next week, when I have more time.

Greetings,
Oliver


Attachment: signature.asc
Description: This is a digitally signed message part


Reply to: