How about a configfs with Config::Model ?
During the Config::Model presentation at Debian mini-conf, I was asked whether Config::Model could be used from other languages than Perl.
Of course, config-edit command line can be launched from any program with any language, but we can hardly call it an API.
There’s also the possibility to use Config::Model::SimpleUI to fork a process and send commands on its STDIN and get results on STDOUT. But using this from another program is awkward.
On kernel side, /proc and /sys are widely used to get information from the kernel and set kernel configuration.
How about using a similar approach with system configuration data ?
Configuration data from config files is already mapped into a tree within Config::Model. This tree can also be mapped to a file system structure. This file system structure could have the following layout:
| `– PermitRootLogin # contain 0 or 1
As a bonus, this file system would provide a unified access to all system configuration data available through Config::Model.
In any case, people would still be able to tinker configuration with their favorite text editor on a file in /etc. The modification will be propagated to the corresponding entry in the /conf virtual file system. The reverse will also be done.
Anyone interested ?
All the best
PS: Further technical discussion will be held on Config::Model mailing list: config-model-users at lists.sourceforge.net
2010.11.25 edit: specified that config data can still be written in usual config file.