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

Re: Configuration frontend



Stephen Crowley <crow@debian.org> writes:

> Has there been any talk of a central configuration frontend? I was thinking
> it'd be really nice to have something where each package registers a script,
> similiar to how the menu system works. 

Yes, there has been talk about. :)

The best idea I saw was to have programms to ask questions for the
script. Something like:

dpkg-question --yes-no "Do you have a Gateway?"

dpkg-question could then ask via slang, gtk or look into a database.
The beauty of the aproach is that the install scripts don't have to be 
rewritten that much.

> The script would tell the frontend all the "variables" it has for lack of a 
> better name, the data types for each var (ip address, string, number etc), 
> default values and the valid range. You then modify them in the 
> configuration  manager, their could two frontends to it at least, one gtk 
> based and one console based (slang?). Then the program passes the var back 
> to the script and the script could possibly report invalid values back, 
> if all goes well it writes the confdata back to the file. Could there
> could be an "apply" command to write the conffile and restart the daemon?

The problem is that questions depend on the answeres of the previous
questions.
Take the example of a gateway:
1. Do you have a Gateway?
2. Whats the IP?

You only want to ask for the IP, if there is a Gateway. You need a
quite complex Syntax to allow for all sorts of dependencies.

> The generated config files should be easy to edit by hand, it shouldn't
> be dependent on storing some codes in comments for the script to parse or
> anything like that.

I think the best way to represent a configfile would be as a shell
script.
------------------------------------------------------------
#!/bin/sh
# Config for Network

# eth0
NETWORK_DEVIDE_0="eth0"
NETWORK_IP_0="192.168.1.1"
...
------------------------------------------------------------
The config file can than have comments in it to make editing by hand
easier. The install script would just source the config script and all 
variables would be set. Thats probably the easiest way to read in the
config variables in the install script.

> Just an idea, please let me know what you think. I need some input before I
> start coding on this.

Think about about a easy to understand syntax for dependencies of
questions, maybe something like "make menuconfig/xconfig" does with
the kernel config.

May the Source be with you.
			Goswin


Reply to: