Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror
×
Unix Operating Systems Software

How to Fix the Unix Configuration Nightmare 482

jacoplane writes: "There's an interesting article on freshmeat talking how sorting out some kind of standard for configuration could really help Unix systems could be more user friendly. The article points out that since Apple has managed to build a quite usable system on top of NetBSD, it should be doable to do the same for open-source interfaces."
This discussion has been archived. No new comments can be posted.

How to Fix the Unix Configuration Nightmare

Comments Filter:
  • by evilviper ( 135110 ) on Monday February 18, 2002 @06:57AM (#3025686) Journal
    There are situations were I've wondered why they went off and created their own configuration file format just for that one application, but that's not too common. The problem with a universal format is that each application need to do different things. Typing ALL apps to one format would in many cases make configuration changes more difficult.

    i.e. instead of changing one thing, you have to make the change for every interface/terminal/etc it is running on. Just an example mind you.
    • Which is why you use XML. Human readable, parsable via common code library, extensible (that's the X part...)

      The cool part is that one tool would be able to configure new things that didn't exist when the configuration tool was designed as long as the tool was well thought out and feature complete. Since the current crop of configuration tasks is quite diverse already, I see no reason why this wouldn't be doable.

      With this system, you would also never have to write your own GUI config tool for each app ever again. KDE, Gnome, Samba, Apache, Mozilla, Galeon, etc. could all dump their custom X / web-based tools if they desired (you could even have a web-based version of the tool.) Hell, you could even use this to configure the kernel.

      For migration, separate utilities could import / export from the new XML based files while all the software that uses config files get's updated.

      Some software such as Apache is already close as it is already somewhat xml like.

      The one thing I ask that of ANY config tool is that it NOT be like the Windows Registry, Don't put everything in one big-ass binary database. That's the most hostile, fragile pile of crap on the planet.

  • These days, one can usually get away with the "./configure; make; make install; " routine and not need to worry so much. In any case, some of the charm of Linux does lie in your being able to tweak things. And Apple had the luxury of making one decision about software questions and implement them across all hardware.
    • Install/configure (Score:5, Insightful)

      by autopr0n ( 534291 ) on Monday February 18, 2002 @07:36AM (#3025774) Homepage Journal
      Sure, installing software is easy. Unpack and compile. We are talking about configuring software.

      Like getting sendmail to rout and forward mail, apache to serve up web pages you want, BIND to bind names to IP address, etc.

      These tasks arn't "hard" or anything, but they do require a lot of reading on the part of a Newbie. In the windows world (don't know much about OSX) Most of that stuff can be done via am intuitive GUI.

      Flame me if you want, but I'd greatly prefer a system that didn't require me to learn diffrent config file formats for each service I want to have running... or deal with a hodgepoge of 'easy config' program hacks.

      A simple, standard configuration system is definetly the way to go.
      • There is no simple, standard way to configure complex things. A nice GUI works fine if all you want to do is something simple, but when things get hard, you have to dig into the guts and really understand what is happening.

        Now, using a standard syntax may hold some promise of making configuration a little easier, but the hard things will always be hard. No GUI will ever change that.

        Also, text files are easier to manage remotely. Just give be ssh and vi and get out of my way :)
        • Re:Install/configure (Score:4, Interesting)

          by walt-sjc ( 145127 ) on Monday February 18, 2002 @10:28AM (#3026280)
          This is a defeatist attitude. Did you even read the article? If MS or Apple can do it, we can do it, and we can do it better.

          Now a GUI won't make people understand what they are doing or do the work for them (ever configure MS Exchange? That's a bitch....) but what it DOES do is make the configuration easier to navigate.

          By using an XML based file format (as I proposed in a previous comment) you get the best of both worlds. The Apache config file is a close example of what I was thinking (it's not XML, but it is XML "like".)

          An application would actually have 2 configuration files: one that actually contains the configuration data (like httpd.conf for apache) and the other to describe the options, help for the options, defaults, etc. to the configurator GUI. Both would be XML, would be extensible as hell, and provide a single tool for configuring any application, current or future.

          As I mention in a previous post, a set of importers / exporters would provide a way to migrate until the various applications were updated to use the new format (sendmail may NEVER change...)

          So you get what you want. Hell it would probably be better as you would no longer need to memorize all the differet quirks / rules for different applications's configuration language.

          • by Cardhore ( 216574 )
            You are exactly right. Have one or two files for the actual configuration (/etc/app.conf and $home/.app.conf), and one file that describes the configuration: its options, parameters, and help strings (perhaps in /lib/etc?). XML would probably be the buzzword to use here.

            Think about it--with this method, you only need to write ONE gui configuration tool, for everything!
          • Please check this [e-smith.org] out.

            It's the esmith configuration schema.

            They have already solved this problem in a neat way.
  • by evil_roy ( 241455 ) on Monday February 18, 2002 @07:06AM (#3025705)
    Have a look. webmin [webmin.com]
    • by Nailer ( 69468 ) on Monday February 18, 2002 @07:48AM (#3025816)
      The problem isn't with the lack of a standardized configuration tools, its a lack of standardized configuration file formats. This allows:
      • Systems administrators to work with new applications config files without worrying about how exactly a comment should look
      • Automated parsers that don't have to be re-written for every config file - you'd have a whole buynch more webmin modules if this was the case.
      • GUI folk to be able to use their graphical interfaces knowing that they won't screw up a config file, because there's a very rigidly defined format for the config file and a standard parser that's very well tested
      • Better manipulation, imports, exports, etc of information into config files, as a popular format allows for the development of tools to perform these tasks across many different applications
      • All that is important. Yet, for now Webmin really does do a good enough job.

        Even if these changes were added in right now, it would still take a few years for them to be so common that they could be relied upon.

        • Webmin really doesn't do a good enough job. Really -- try using webmin against the latest version of most software and you'll be sorely disappointed. The problem is that the people who release the webmin modules are NOT the people who release the software that webmin is configuring.

          What we need is exactly what the author is proposing. A generalized configuration system that works off meta data that the software developers supply.

          • All the possible configuration options in logical groupings
          • descriptions of each option
          • default values
          • validations on input values
          • being able to label options as 'experimental', etc...
          • and of course option dependencies - that is if this option is turned on, then enable these 5 other options.
          To do it right you'd ultimately you'd probably need to have a very light scripting language with flow control and variables.

          But the important thing is to get a workable standard in place, one that the majority of developers can rally around and will be happy to develop configuration scripts for their applications. Most developers wouldn't even have to change the way their application reads the config files - documenting everything in a form that this 'configuration manager' can use would be enough. It's already been too long - we shouldn't wait any longer to get this process moving forward.

  • by osolemirnix ( 107029 ) on Monday February 18, 2002 @07:07AM (#3025706) Homepage Journal
    I like the idea, such a tool would certainly be nice. Unfortunately the article only focuses on the Syntax part, the file format and access. I would think that is rather easy, use some kind of XML and you're already halfway there.

    The part that makes such a system really useful however, is a standard agreement of which information is stored and what it means. This is where the Windows Registry falls down. And Unix is even worse, because all it has is some common soft-of-agreed-upon shell variables, like $EDITOR etc.
    Apple is able to do this better because they set the standards for the OS (even more than MS). The can have one central "registry" for something like default associations of MIME-types with particular applications and define an API so every application can use it and a user doesn't have to change his settings in his browser AND his mail client AND his ftp client, etc.

    Given the diversity of the unix crowd, the latter seems difficult to me. Maybe they can include it as part of LSB for a start?

    • by j7953 ( 457666 ) on Monday February 18, 2002 @07:48AM (#3025814)
      I would think that is rather easy, use some kind of XML and you're already halfway there.

      No no no. XML is not the magic solution to all problems in communication, data storage and usability. Using XML does have many advantages for some applications, like communicating over the internet, but I don't see how

      <DocumentRoot> /some/path </DocumentRoot>

      is so much more usable than

      DocumentRoot /some/path

      The only thing XML will do if widely used for configuration files is make maintaining them harder for those who'd like to do that by using shell scripts or simple text editors. As a very basic example, using XML makes configuration files harder to grep. The above example might also be written like this:

      <DocumentRoot>
      /some/path
      </DocumentRoot>

      This is completely legal XML, but if you grep DocumentRoot this file, you'll get the following result:

      <DocumentRoot>
      </DocumentRoot>

      which is probably not what you wanted.

      • There's nothing stopping you from setting up most configuration files in that same un-grep-able way.

        For example:

        ACL James \
        Bob \
        Mary \
        Lauren

        Most UNIX programs will even ignore whitespace in the config file. I would say that your problem with XML is not related at all to XML, but that you have a problem with a specific style.

        IMHO, a standardized way of writing config files is definitely needed. XML would fit the bill, especially since it's so popular. Writing a new configuration language might be fun (and even a seemingly better solution), but every single person running Linux would have to learn that configuration language. Not everyone needs to learn XML.
      • I don't see how

        <DocumentRoot> /some/path</DocumentRoot>

        is so much more usable than

        DocumentRoot /some/path


        Try to nest several DocumentRoots which have different properties. If we ignore those possibilities: XML is a standardized format. There are several usable parsers for almost every platform out there. Having an Apache-style file follows no specific standards. Parsing will also be a bit more difficult.

        The grepping problem that you mentioned is really a non-problem: use xmlgrep, xmltree or similar utilities to find the data note that you are looking for.
      • The nice thing about XML is that parsers and standards exists for the file format itself and for metadata describing the file format. While DTDs are a start, XML schema are even better, telling you (The generic config file program reading the XML file) exactly what values an element is expected to have and how they can be nested.

        You can hack out a CSS file that would describe to any XML enabled web browser how to display your file in a much more readable format and XPath lets you slice and dice an XML file however you want to. I've run across an XML enabled grep-like program too, though I've never actually had much need for it.

      • I agree - though I think that XML is a GREAT idea for *nix to use, the format is just too flexible to just say "use XML" and leave it at that. There needs to be some sort of standard way of using XML as a registry so it's not a complete nightmare.

        Other variations:

        <DocumentRoot>

        <setting name="someSetting">SettingValue</setting>

        <someSetting>SettingValue</someSetting&gt ;

        <someSection value="SettingName">settingValue</someSettin g>

        <someSection>
        <settings>
        <settingGroupName>Test</settingGroupName& gt;
        <setting name="SettingName" value="settingValue" />
        </settings>
        </someSection>

        </DocumentRoot>

        Etc. The variations on hierarchies and values are endless and is my main beef with XML. It sometimes can be too flexible and people who are using XML (especially newbies) make it overly complex or not suffieciently complex enough for expansion. In other words, this needs to be thought out.

        But again, XML is a good idea. I hope it gets adopted as a general mechanism in *nix, but not in some random way...

        -Russ

  • by andykuan ( 522434 ) on Monday February 18, 2002 @07:09AM (#3025711) Homepage

    In the writer's outline section he has a few bullet-points that scream "XML!" (I'm paraphrasing here):

    1. A core system to handle parsing, verification, etc. -- If app configs were based around XML, you could use any of a dozen XML parsers out there.

    2. A configuration format description file. -- Hmmm, sounds like a DTD...

    3. OS-neutral. -- XML was meant to be portable from the get-go.

    The other items lined up pretty well with what XML is all about as well. Anyway, that said, I'm not so sure this'll ever happen since, from a developer's point of view, it's a lot simpler to slurp in a bunch of lines from a text file with fgets and chop it up into words than to have to somehow link in a third-party XML parser.

    • Other points in the article that scream XML to me:

      * A key element would be the configuration format description file. This would list the configuration options for a given piece of software, giving for each one the name, type (boolean, list, string, etc.), options, category (for subsections within the config), and help text (short and long).

      This looks very much like XML Schema [w3.org] to me - it can specify all these data types, including enumerations, and a schema-aware XML editor (eg XML Spy [xmlspy.com] in the Wondows world - anyone know the best Linux option?) will prompt you with help-lists of valid elements and attributes, or list of enumerated values. Doesn't do help text by default, but has an expansion mechanism (xsd:appinfo) for adding application-specific to be added to a schema.

      * It all needs to be language, distribution, and operating system neutral, so as to avoid turning off any potential software developers who might find it useful.

      I don't know of any programming language or O/S that doesn't have an XML Parser (many don't yet have XML Schema support, but if you stay off specifying default values you don't need that at run time). And XML is good for natural languages - UTF 8 or UTF 16 from start.

      There aren't many formats that are equally machine and human readable, even fewer that allow document struture and data typing, and still fewer that have open or free implementations [oasis-open.org] on practically all platforms.
      • First, XML is not a silver bullet. The thing this article screamed was not "XML" but "API". Define the application programming interface for a library, and stop thinking that each application must directly access the native data.

        Second, XML Schema is a definition for an XML language, not a document described in a particular XML language. XML is a meta-language, you have to MAKE a dialect using a schema or DTD first. XML Schema could not, for example, include primitive types for IP addresses (very common in config files), or validation constraints for integer values.

        Third, XML parsers are no-where near as ubiquotous as you would like to believe. To date there are no (zero, zip, nada, nothing) fully compliant XML parsers. Read the XML spec. carefully and understand just how many IFs and BUTs there are to creating a parser. Xerces and MS's parsers are the closest, but still have a number of problems. Expat-derived parsers happily handle a large subset of XML, but not everything. A vast number of parsers out there ignore the DTD, which means they cannot handle entities (which is a big issue).

        Finally, there is nothing intrinsically human-readable about XML. This is common bullshit sprouted by those who haven't actually considered the requirements for human understanding. A simple .ini-style line delimited key=value is the most readable and understandable (from a psychological viewpoint) configuration format.

        • Wrong wrong wrong (Score:3, Insightful)

          by ttfkam ( 37064 )
          The thing this article screamed was not "XML" but "API". Define the application programming interface for a library, and stop thinking that each application must directly access the native data


          Yes, and the discussion went to the next step and started talking about possible APIs. The parsing of XML (DOM and SAX -- DOM for in-memory data structure and SAX for streaming access) are well understood and, most important, already done with innumerable tools already written.

          XML Schema could not, for example, include primitive types for IP addresses (very common in config files), or validation constraints for integer values.


          Wrong! Wrong! Wrong! You haven't read the spec and are obviously making assumptions based on what you've heard from others who haven't read the spec either. XML Schema allows not only the specification of integer, string, float, date, etc. values, but integer subsets (greater than and less than) and string patterns (through regular expressions). And RELAX-NG can use XML Schema's datatype support as well.

          Do you have something that does validate IP addresses for example or were you just complaining about how one thing doesn't (even though it does) without showing anything that will solve the problem. If you say regular expressions, I must remind you that XML Schema supports regex matching of attributes and element data.

          To date there are no (zero, zip, nada, nothing) fully compliant XML parsers.


          Could you please enumerate these non-compliance issues? An encoding issue? Bugs in DOM or SAX support? What? I wonder about the vitrol of your argument without any specifics. Especially since I been using both parser that you mention (and a few others) without any noticeable issues associated with the standard. Any problem were usual to do with parser extensions to the standard which are fairly simple to avoid.

          A vast number of parsers out there ignore the DTD, which means they cannot handle entities (which is a big issue).


          You're right! That is a big issue. Unfortunately for your argument, it is not an issue with the leading parsers that you mentioned yourself: Xerces and MSXML. The default parser for Java (Crimson through JAXP), the default parser for Windows (MSXML), the default parser for Perl (XML::Parser I think...haven't used it yet) to name a few ALL handle entities. This is like saying that there are many web servers out there that don't support CGIs with the obvious intent of dissuading use of web servers.

          A simple .ini-style line delimited key=value is the most readable and understandable (from a psychological viewpoint) configuration format.


          I agree, but you're missing an important aspect here. INI files are usually one and at most two levels deep. They do not handle hierchical structures well at all! Let's look at a snippet from a default Apache configuration file.


          # The following lines prevent .htaccess files from being viewed by
          # Web clients. Since .htaccess files often contain authorization
          # information, access is disallowed for security reasons. Comment
          # these lines out if you want Web visitors to see the contents of
          # .htaccess files. If you change the AccessFileName directive above,
          # be sure to make the corresponding changes here.
          #
          # Also, folks tend to use names such as .htpasswd for password
          # files, so this will protect those as well.
          #
          <Files ~ "^\.ht">
          Order allow,deny
          Deny from all
          Satisfy All
          </Files>


          What do we see? Hmmm... Because the key/value pair format doesn't allow hierarchy, they fell back to something that looks a bit...er...XML-like. And it isn't key=value, it's key[whitespace]value. Yet another issue: one file has the equal sign and others don't. I thought we were aiming for consistency? And what if the parameter is a message and that message has a newline character? A '\' at the end of each line? A '\n' where appropriate? These are problems that XML has solved.

          And let's not forget Unicode support. We English speakers may have a hard-on for English, but can't you imagine a case where a program intended for a non-English speaking audience would want -- if not the names of the parameters themselves -- parameter values in alternate character sets than ISO-8859-1 (Latin1)? And before you rebut with UTF-8, do you want to write the UTF-8 translator? What about the other codesets? Are you strictly limiting to UTF-8? This is another area of XML parser that keep it simpler for the programmer. Transcoding is done for you and is most likely better implemented and supported than what you or I would come up with.

          And when you have multiple "Files" definitions? Well, multiple blocks right? The "Order," "Deny," and "Satisfy" parameters are associated with the "Files" definition, yes? So why aren't you associating a group of "Files" definitions together? Because that would require further hierarchy? Would you end up with something like this?


          <FilesDefinitions>
          <Files ~ "^\.ht">
          Order allow,deny
          Deny from all
          Satisfy All
          </Files>

          ...other Files definitions...
          <FilesDefinitions>


          Set up a relatively complex configuration where you have virtual hosts and those virtual hosts have behavior different from the default. What's that? You include them in tags by host? Tags that look somewhat like XML anyway you say? Imagine that!

          And what about the comments? For some formats, the comment is the ';' character. For others it is the '#'. And none of which I am aware differentiate between implementation comments and actual directive comments. For example. the comment above describes the configuration directive so that any configuration editor could conceivably read in that info and display as help to the user (assuming that all comments were kept correctly before the directive and not after or on the same line). But what if you wanted to make comments about your specific installation. You are making comments so that others in your working group can see why you made certain changes to the config file, right? So how are they differentiated from the primary directive comments. This is the type of problem that XML namespaces are intended to solve -- a way of giving demarcation points to distinct pieces of (sometimes) unrelated data or simply the clean combination of multiple schemas so that your schema definition doe not bloat to immeasurable levels and different schemas can easily share with one another.

          Something keeping back Linux/BSD/UNIX is the stubborn, 1337 coders who spent all day figuring out a config file that some joker on the net thought would be a keen config format but forgot to comment it. Let's face it, Apache is not the norm. Config parsers are a known problem with known solutions. Writing a config file parser is not the primary focus for most programmers out there. The config file is a necessary evil to them. Let's make it easier and just say, here's your DOM interface. It's well documented, works well for the limited dataset with which you a working (config files are usually less than 50K), will handle any configuration organizational type you want (hierarchical, flat, etc.) and will save you the time of writing a parser yourself.

          Have a nice day.
    • What really should be done is to throw a wrapper around the XML parser so that you can do something simple like value = getpref(name) without specifying anything more than the config file location and file format (although probably better handled using a header at the top of the file.

      XML is great as a data interchange format, but it's a pain for humans. Compare /etc/passwd in it's current form to an xml representation. Which is easier to understand at a glance? Simply throw a comment at the top of the file explaining what each field does and the non-xml version works extremely well. Writing scripts to work on flat files is much easier than xml, as is searching.

      Really, there's no reason why the config library can't handle multiple file schemas according to developer or user preference.
    • by khuber ( 5664 ) on Monday February 18, 2002 @08:35AM (#3025917)
      In the writer's outline section he has a few bullet-points that scream "XML!"

      I'd agree that XML is a good basis, but "XML" really doesn't provide much by itself. It's just a file format that is human readable. If you just use XML with a bunch of proprietary tags, your own XML language so to speak, you really don't gain much over the existing different syntax config files.

      An automated tool has no clue what your ipaddress (or whatever) tag means at all. You need to provide additional context for tools to understand the semantics of the configuration data. To make configuration files understandable in a more intelligent sense, you need to either restrict the tags you use to your own configuration language, or you need to provide metadata of some sort.

      Why is this intelligence necessary? Well there are all sorts of dependencies and relationships in configuration files. You might want a GUI to let you know if you change something that may break another setting, and so on. Plus ideally you would only allow legal values to be set. Data typing could be done with W3C XML Schema Definition Language, or RELAX NG schemas.

      Which brings me to RDF, which I think would be better suited to this task than XML alone. If you use RDF (see http://www.w3.org/RDF/ [w3.org] ) you make it much easier to have a self-describing format that tools can do more intelligent things with than raw XML. While I don't think RDF, DAML+OIL, et al is enough to create a Semantic Web as Tim Berners-Lee is hoping, it _is_ a step in a higher-level direction that will support more intelligence in processing data.

      Mozilla already uses RDF for various configuration files and I'm sure there are other applications that do too. Mozilla has a whole bunch of stuff about their RDF here [mozilla.org].

      XML is just a tree of "stuff" in human-readable format. RDF lets you set up properties and relationships in the data in a standardized way. I don't have a brilliant example to prove this to skeptics, but really it is a better way to represent a lot of types of data you want to be able to query. There are many knowledge bases, expert systems and other query engines already out there using RDF and even higher-level languages like DAML+OIL.

      -Kevin

    • If you want to do basic syntax checking at the XML level, you end up with configuration files which are no longer human readable. Imagine mapping all those sendmail rulesets to XML! There's no better way to reduce readability, and you cannot use all the existing HOWTOs and books.
    • Mac OS X PLists (Score:3, Informative)

      by ZigMonty ( 524212 )
      You are describing Mac OS X's Property list (Plist) format. All Application information (file types etc) and user preferences are stored in .plist files, which are XML. There is easy API for apps to use. Here's the carbon docs [apple.com] for it. The Cocoa plist overview docs still aren't up yet but I can assure you that it's even easier in Cocoa.

      Quick example taken from the above docs:

      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList .dtd"><dict>
      <key>Year Of Birth</key>
      <integer>1965</integer>
      <key>Pets Names</key>
      <array/>
      <key>Picture</key>
      <data>
      PEKBpYGlmYFCPA==
      </data>
      <key>City of Birth</key>
      <string>Springfield</string>
      <key>Name</key>
      <string>John Doe</string>
      <key>Kids Names</key>
      <array>
      <string>John</string>
      <string>Kyra</string>
      </array>
      </dict>
      </plist>

      Note: The <array/> tag is specifying an empty array.

    • I have played around with this exact idea in the past. I got a semi-working prototype working, but then gave up as the huge amount of work needed became apparent. Here are the highlights:
      • Create a parallel configuration system depository somewhere outside of /etc, like /conf. That depository should only contain system and meta-system level stuff.
      • Keep application-specific configurations in the application directory.
      • Get rid of the ages old /usr, /bin, etc, etc. Blatantly copy OS X. OS X has solved most of the metadata management issues already.
      • Maintain a separate, read-only hierarchy where programs can still get their config files (/etc), libraries (/usr/lib, etc), etc.
      • Have a system deamon that reads the new metadata repositories and creates the legacy ones for the legacy parts of the sytem.
      XML is not that bad if you are not creating it or reading by hand (but the cool part is that you can fix it by hand as a last resort). And it's scriptable as hell. Check out the Gnosis XML utilities [gnosis.cx] in Python (disclaimer: I did contribute to this project). XML_Objectify for example allows you to build a full object tree of the XML repository, complete with attached methods (on a per *tag* basis) and everything. Creating a /etc file from an objectified XML one is a cinch that way.

  • Is Ganymede [utexas.edu] a starting point for a complete centralized configuration tool?
  • I recall some discussion earlier on /. that talked about how OS X-on-NetBSD wasn't as clean as many thought. In fact, it turned out that the /etc was pretty much bare except for some file structure that was like a Windows registry (except for it was for Mac). Can someone verify this?
    • What you appear to be describing is NetInfo, a Windows-registry-like component that more or less functions mostly in place of certain typical UNIX config files. It's a NEXTStep legacy, but, unlike the Registry, it somewhat sidesteps an otherwise nightmarish way to handle OS configuration. And, it doesn't scare the bejeezus out of you when you look at it. The Netinfo Manager application will be used commonly by most experienced UNIX users to reactivate the root process, which Apple switches off in OS X for security/safety reasons.

      OS X is based on FreeBSD, albeit an older version. It's pretty damned nice for an older kernel.
    • One other thing--OS X has its own file directory structure--User for usr, for instance, and a few other changes. Functionally, this is FreeBSD, but Apple's directory parallels allow mere mortals to grasp its naming. Doesn't make for smooth going for experienced UNIX heads, but a trip to the Terminal shows that what they need is indeed there. There are just symlinks to the common directories, I believe.

      OS X is also one of the very, very few *nix systems that is CASE-INSENSITIVE.
  • JavaBeans does everything that this article wants now. It suports introspection, special field editors... Then you can build general purpose editors for any type of user. Couple this with javaspaces, for storage. JavaBeans is a shipping technology, but JavaSpaces is still a bit dodgy last time I looked (6 months ago.) Sun have spent alot of time getting this right, there is no good reason te reinvent it.
    • You expect the open source community to use Java!? It's plain C all the way! (just look at Genome... hell, there are some guys (dotGNU IIRC) who want to implement .net in plain C!)

      Ok, so that's not entirely true. Some OSS people like java (Freenet, Apache Jakarta). But I seriously doubt that anything Java based would ever make much inroads in the free Unix world. (Maybe Solaris could make some headway, though :P).

      And there's a few good reasons why it shouldn't. Java is a little top-heavy, and it's not platform-neutral, it's its own platform... and connecting it to other technology via the JNI is a pain in the ass. I tried JavaBeans once, on a windows box at work. It was a nightmare. I ended up using TCP/IP for interprocess communications. (then again, TCP/IP might not be a bad choice for a central config server, you could do things like remote config. hrm)

      Anyway, I think XML plus some schemas might go a long way to doing what we want, without requiring everyone to link in a JVM.
  • GConf (Score:2, Informative)

    by Metiu ( 14532 )
    As it has been already said in a comment on [fm], the answer is GConf:
    it has the ability of configuring apps and has the option of using a DB or XML as a backend.
    Start porting!
  • Other side to this (Score:4, Insightful)

    by larien ( 5608 ) on Monday February 18, 2002 @07:21AM (#3025740) Homepage Journal
    This is something I think would help linux become more widely accepted, but there's more to it.

    I was thinking this morning how I hadn't udpated my Apache server in a while, and wondering whether I should apt-get the latest version (Apache is kind of important for security, as it's the only open port on my system from the internet). However, I've done various tweaks to config files which would get overwritten if I accepted the Debian standard file, but I don't want to miss out on any new settings that could be important. I know I can do a diff, but that's effort I'd rather not have to go through.

    This kind of situation is where a registry-like interface is useful; the install program just has to do a quick 'if-not-exist then add' to any new settings and leave the rest alone (or ask if you want an overwrite of all settings, with appropriate disclaimers).

    This kind of thing is difficult to do in a flat file split into different sections (if there isn't a concept of sections, you can just tag the setting on), but trivial in a registry structure, especially when the tool (dpkg-upgrade/apt/rpm) has to handle all the different file formats. However, linux/Unix users would rebel en masse if the registry got inflicted on them (with damn good reason! I like being able to fix problems from single user mode using vi!), but some form of layer between the text file and settings may provide the best of both worlds (programmatic ease and editability). apt/dpkg/rpm could use the interface to add/modify settings without splatting your custom tweaks while still adding the new required settings.

    Unfortunately, we're starting from a difficult point, with thousands of applications with many different requirements for their settings. Hopefully we can get some covergence over time.

    • If you are worried about security, why would you let *any* automated install upgrade your configuration file. Thats what the diff ability is there for, so you can see what's changed and make the necessary modifications yourself. If you haven't read up on the new changes, why they're there and what else they affect, then just putting them in is a Really Dumb Idea (TM).
  • Apple fixed it... (Score:5, Insightful)

    by Adnans ( 2862 ) on Monday February 18, 2002 @07:23AM (#3025745) Homepage Journal
    Because there is only one captain on the ship, Apple. Good luck fixing it in the Linux world. The only way it might have a chance of working IMHO is if such a proposal gets included the Linux Standard Base [linuxbase.org]. Here's a bold idea, why not copy the way Apple does it??? No need to reinvent the wheel...

    -adnans
  • by Spoing ( 152917 ) on Monday February 18, 2002 @07:25AM (#3025747) Homepage
    I've mentioned this before, so I'll just quote myself;

    1. Get Webmin. Setup Webmin. Use Webmin. Show Webmin to all other administrators. Teach them Webmin. Eventually, when the time is right, show Webmin to management. Drive home the idea that Webmin is a one-stop-shopping, simplified, and robust server management web app that anyone can grasp (if not master). Point out that Webmin supports Unix (including OSX) but not Windows servers (except for Windows with Cygwin). Over time, point out that on the server side, the few remaining Windows servers take much longer to manage and are less reliable then the multitude managed under Webmin.
    2. www.webmin.com/webmin [webmin.com]

    The complaints about Webmin is that it isn't perfect. It doesn't solve the desire for a universal config mechanism or encourage the editing of files directly. OK. It doesn't. Yet, it exists now and is a lifesaver when using multiple UNIXs. Anyone who wants to know what any Webmin module is doing probably also knows how to use find -cmin, ls -lart, or read the module itself since they tend to be in Perl.

    When a universal config comes along, I'll use it and guess what -- it'll work with WebMin.

    Webmin might not be the right thing, but it is good enough for a vast number of uses [thirdpartymodules.com].

    • Your post was a bit vague on the name of the actual product you are endorsing...

      ;^)

      (I just counted the word 'Webmin' like 17 times in your post...)

      Actually, I couldn't agree more.
      A couple of weeks ago, my boss called me 2 hours before I was supposed to be at work to tell me that something needed to be fixed on the server. I literally rolled over, grabbed my laptop, logged in using the ssl option, fixed it and went back to sleep.

      Now you might say that all I really needed was SSH and VI, but I hadn't had any coffee yet and Webmin just required a bit of clicking. It rarely screws up and doesn't mess with your config files.

      I wrote a bit more on it on my web site [mmdc.net] a while back - scroll down about half way.

      Cheers,
      Jim in Tokyo
      • (I just counted the word 'Webmin' like 17 times in your post...)

        Well, I went to both the Creation Science and L.Ron Hubbard schools of logic -- both known for scientifically proving a point by repeating it as many times as possible no matter how correct. Unfortunately, I feel as if I've shamed them since I did include some information that could be verified. Facts are such pesky things. :)

    • I wasn't going to get into this, but webmin is and always has been a security nightmare. Go search bugtraq for webmin bugs. Everything from insecure files in /tmp to session hijacking. Not to mention that you often find yourself in a simular trap found in package management, once you use it, you better keep on using it as webmin mangles any pre-existing conf files.

      Also, ease of use often equals lack of knowledge. I am sure somebody is gonna mod me down for being a troll or flamebait, whatever. I learn the apache conf syntax, I only have to learn it once. That knowledge is portable across any systems I would be installing apache on. I would bet someone who can do it by hand can do a better job then someone who can only do it if they have webmin installed.

      I also hope no one is implying that a generic gui based configurator can handle anything but the most basic and common configurations. If I (using the apache example) install and implement a little known module, mod_witch or mod_log_multicast, are you saying that webmin can handle that? Well, go in and configure it by hand you say? Well, I can't because webmin has mangled the config and if it hasn't, it still is not going to be aware of the changes.

      Rant on: what is wrong with vi? Seriously? Or pico or whatever editor you want to use? What is wrong with taking 5 minutes out of your day and actually reading the sample.conf that comes with almost all software? Not only can you then go in and actually have the power to do what you want, with confidence and not having to rely on another piece of software or hope that a module exists for you to do what you want, you actually will have increased the amount of knowledge that you have and make yourself that much more valuable.

      I would love to meet an administrator who could configure everything and get it working...oh sorry, cavent, said admin can only do it with webmin or something simular. Right, I can see that being a showstopper in a job interview.

      SealBeater
      • Like rants? So do I.

        True: things like package management can be a problem -- any automated tool can be. It's not the same as a bare-metal hands-on I-wrote-the-code installation. Never will be.

        Yet, there are people who can't or won't learn every nuance of every system file. There are people who know and like one OS or distribution or server application and hate everything else. Those people are called your co-workers. I know, I have the same co-workers.

        There are other groups, call them managers, who want to know that when you get hit by a bus they are capable of finding someone who can figure out what the hell you were doing just before you got your Greyhound tatoo.

        If Webmin causes you security problems, be that person who can check for those problems before deployment. Most modules are in Perl, and the permissions can be checked system-wide on any static files easily enough. Hell, create a crontab to check if you don't trust others, or even write a Webmin module to do a basic check when you're not around!

        [Full-Rant Mode]

        1. ...If we want a chance of getting Unix to the unwashed masses -- to enlighten them a bit, maybe to get them to do the right thing.

          ...If we want to break out of the present canabilism between different Unix systems.

          ...IF IF IF...we _NEED_ something that works like a camel's nose.

          We _need_ to get in more tents before we get any figs. Right now, most non-Unix folks don't give a fig about Unix. :)

        • ...If we want a chance of getting Unix to the unwashed masses -- to enlighten them a bit, maybe to get them to do the right thing.
          Much better in my view is to wash them.

          While there is no excuse of course for needlessly hard or complex configuration files and such, when simplification comprimises usability, security and capability it has gone too far. Rather than dumb-down the software, let's encourage people to actually learn about the tool they're using. Perhaps once people understand what security is and why it's important, they might finally start adopting security-aware proceedures.

          To summarise: smarter people, not dumber tools.


        • ...If we want a chance of getting Unix to the unwashed masses -- to enlighten them a bit, maybe to get them to do the right thing.


          You think you can bring enlightenment by encouraging ignorance? By not encouraging learning and the proper methodalogy to not have to rely on yet another tool to get the same job done? That you can get anyone to do the "right" thing by encouraging them to not read and learn, just to find the "easy" way out?

          • You think you can bring enlightenment by encouraging ignorance?

            Absolutely not. Right now -- by encouraging only one way of managing Unix systems -- we're not enligtening anyone except ourselves.

            Simplify them, and then we can coax the Unix ignorant into learning a wee-bit more...a universe more then what they have now.

            What you suggest is preaching to the chior. I'd like to see a larger chior, even if they can't cary a note. Later on, we can teach them how to sing. Right now, they aren't.

        • I am going to address some other points to this.

          Yet, there are people who can't or won't learn every nuance of every system file.

          Then they should not be in charge of administering a box. "Can't" implies an inherent lack of ability. Good enough reason not to be an admin. "Won't" implies an inherent lack of motivation. Good enough reason not to be an admin. Both are reasonable assurances that a machine placed under their control will suffer.


          There are other groups, call them managers, who want to know that when you get hit by a bus they are capable of finding someone who can figure out what the hell you were doing just before you got your Greyhound tatoo.


          They can, it's called hiring someone who knows what they are doing, as opposed to hiring someone who knows how to install webmin. By your logic, it sounds like you are advocating that they should be able to hire someone who doesn't know what they are doing. Doesn't work in the real world and places that do that inevidably fail.


          If Webmin causes you security problems, be that person who can check for those problems before deployment.


          Right, fix the known problems, ie, make more work for yourself cleaning up after a known insecure app that is supposed to reduce your workload and make your job easier. Without even touching the problems of new hereinto, unknown security issues that you have introduced in the name of ease of use, you just added an additional layer of complexity in an effort to make things less complex. See the flaw in logic?

          SealBeater
          • All good points -- and I agree with them if not with the same emphasis.

            Where we differ is that I desperately want more Unix-friendly work environments, and Webmin is one way to increase Unix adoptation instead of giving in to the flood of Windows systems. If you have this goal also, then tell me how you would address it. So far, I've heard lots of complaints about Webmin but no solutions beyond work harder + be smarter. OK, done. :)

            There are problems with anything, Webmin included. With about 200 plugins, I'd be stunned if there weren't any security issues. A security audit, though, occurs per-app on installation and on a regular basis network wide. Those can't be avoided regaurdless of what you do. But, under most Unix systems, you have a chance to fix security issues.

            Since it will not be possible to fix problems with Windows or any closed source environment/server, why not fix the problems where we can?

            If it takes 2, 3, 5 years to get a unified configuration system why not start with what we can use and fix right now?


            • Where we differ is that I desperately want more Unix-friendly work environments


              I am actually not sure where I stand on that. I would like a more unix friendly work environment in which I can either use *nix myself or have a *nix infrastucture in place. I have been lucky in that that has not been too uncommon, but from a user standpoint, I don't know. I came from an enviromnent were if someone asked if they should use *nix, the answer was no. I thought at the time that that was elitest and repungnant, but after having tried twice to teach people, I can understand. If you're interested, you'll get it, if not, you won't.

              My main objection to making things easy is that often, the student, for lack of a better word, doesn't ever feel the need to progress. It works well enough so why should I learn more, is the previlant attitude. Argh, what's the use?

              My main thing is, a unified configuration system is not a *nix thing, for lack of a better word. Every app out there would have to adopt it, it would be an additional overhead, and what would happen in terms of security holes, updates, etc?

              If I updated the xml lib, would that render my config unusable? World-readable? What about some hard-core customization? A one-off, if you will. What about a brand new module or app? Will I have to wait for the "configurator" app to catch up? What if I update an app and not the config, and the app parses configs differently? I just think it would create more problems then it solves.

              SealBeater
    • I'll begin to use webmin when it supports revision control hooks. Things like this you actually need when you've got multiple admins.

      I hacked together revision control hooks once upon a time for some webmin features, but it was frustrating because there was no common saveConfigFile() function or anything.. each module did it individually in their own way, which meant I had to modify each module to execute cvs after it's save functions. I didn't get as far as having webmin prompt for a change description, however.

      So, as webmin started progressing through versions, while we began rolling out our cvs-based revision control wrappers for /etc & such.. we abandoned webmin.

      Yes, I've got the source code to change it.. do I plan on it? Not especially. Not worth my time right now.

      c'est la vie.
  • by DocSnyder ( 10755 ) on Monday February 18, 2002 @07:25AM (#3025750)
    "gconf" does exactly what the Freshmeat article describes: a unique way of storing configuration. Its frontend is abstracted from the backend which uses a hierarchy of small plain XML files per default but could also use a SQL database or a LDAP directory.

    LDAP is nice on its own, too, with configuration being stored platform- and host-independently, as well as global, group-specific and user-specific settings. Netscape Roaming works this way.
  • Who hasn't though this? Unix/Linux config is a mess. Diffrent files in diffrent folders with diffrent formats. Sure it's all plain text, but who has time to learn diffretn config formats/languages for each program they want to use?

    As for hard to do? I don't see why that would be the case. Just a little bit of XML and viola.

    There are a lot of things in the Unix world that are hard or time consuming to do just because they can be. sendmail.cf. hello!?
  • by Twylite ( 234238 ) <twylite&crypt,co,za> on Monday February 18, 2002 @07:27AM (#3025753) Homepage

    A brilliant article, and a subject which I have tried before (with little success) to broach with various OpenSource developers. Unfortunately the comments demonstrate the lack of understanding that is all too common in the free software world: an inability to distinguish between apis/formats and software implementations; and an unwillingness to move to a more user friendly system.

    GConf and Webmin, for example, are not solutions that address the problem posed by the article. Other comments completely lose the plot: this is about a common configuration format which can use metadata to provide for configuring just about any application, it is not about creating an all-encompassing configuration that will give settings to all applications everywhere for all time.

    Gconf is half of the solution at best. It provides a library (common abstraction) for accessing the data. But an application still has to have explicit knowledge of the data in order to act on it. A configuration framework describes this knowledge to allow any compliant application to act on it.

    Sometimes an example is worth 1000 pictures (and hence about 1000000 words), so consider a simple packet filtering application with an ACCEPT list and a DENY list, which can listen on several interfaces.

    Such an application would have a meta-data configuration file (say /etc/conf/meta/filter.cfg) which specifies: section name=interface count=multiple type=ipv4 ; section name=accept count=multiple type=cidr ; section name=dent count=multiple type=cidr. Now any application can access the packet filter's meta-data file, and the real configuration file (say /etc/conf/filter.cfg), and understand the meaning, to a degree, of the configuration. The types "ipv4" and "cidr" will have to be primitives for the configuration framework.

    Thus a general configuration application could present a tree which has three branches (interface, accept, deny), each of which displays a screen with a list. Appropriate entries can then be added, modified or removed, reconfiguring the packet filter without the configuration application having any prior knowledge of the filter's configuration or requirements.

    With adequate forethough (for the categorisation and types required) such a system can be extremely powerful. A single configuration library can be used by the application, as well as GUI and CLI configuration clients. You could easily have a command in a script: config pktfltr add -section interfaces -value 1.2.3.4 .

    A common library like this can also provide powerful features that a lot of applications lack, like local (user) settings which override global defaults. The library can maintain global, group and user configurations for each application, and getting/setting preferences will take the overlays into account.

    Implementing such a system would also provide an ideal opportunity to introduce configuration versioning. CVS (for example, or arch, which includes directory versioning) could be used to maintain various versions of the configuration files in /etc/conf.

    Arguments about diversity are largely moot. The data format is independant of the data in any well-written program. .INI files, Bind-style files, XML files and SAMBA files can all represent the same information, but they look different. Some are arguably more efficient in some situations. Even the feared Windows registry has the same functionality ... it just makes the (fatal) error of storing everything in a mostly inseparable datastore (sortof like an /etc/conf directory in which you can't treat the various files separately).

    This is a suggestion which needs to be followed through, and supported by the community.

    • nicely said.

      I would deviate slightly. folks should stop thinking of "the solution" as being "a solution" or "it" or some new unified thing. Instead, think of it as "what incremental things can we do that would make the mess less of a mess". If we then implement a few of those things, the world will be a better place, even if we do no more than that. If we keep getting incrementally better, someday we'll arrive at a unified world.

      so, for instance: we need a little API that allows reading and writing of hierarchical data, and an implementation of it that supports one file format. Use it in a project. Implement a second file format and now that project could write its data in either format. Approach other projects that use the same file formats and offer to switch them.

      Note that the two different file formats represent polymorphism: but this should not dictate C++ (or whatever). Rather, there should be implementations of this small "project" in every common language, at least perl, C, C++ and "shell" if anybody has the 'nads.

      I hope I made my point? each little step of this is one incremental thing and is good on its own.

      I've got some other issues, but I don't want a long muddy post. But, f'rinstance, the .* files do not belong in my login directory, or I shouldn't log into that directory, and .* files that I hand edit should not be interspersed with .* files that are filled with computer gen'ed stuff. the ~ (home) directory is a huge stinky mess quite apart from the different file formats. Copying your .dot files to a new login dir is a nightmare. However, notice that with a new API being used to read and write them, the new API could silently move them whenever you're ready.

  • Problems (Score:2, Interesting)

    by countach ( 534280 )
    One problem with standardising is that many Unixy things actually need something that is cross between configuration and a scripting/extension language. This is actually very powerful but not many people are good at writing scripting/extension languages. Guile [gnu.org] was written to potentially solve this problem with all unix tools embedding it for configuration and extension. I believe that this type of approach is the correct one, unfortunately it is quite a full-on solution and brings things into the realm of language wars. Still, this is the way things would go in an ideal world.
  • I'm not all for that GUI fluff but a standard way of installing and running services would be great. This is the reason I run redhat.

    /etc/sysconfig is great. Everything got it's own place. Setting up a new network interface is easy. I don't give much for rc.local.

    /etc/rc.d/init.d is also very easy. No need to figure out what should be run to start bind or restarting qmail. It's all there.

    This is what I would like to see in all dists and all Unixes. Other Unixes possibly has there way of doing things easy but then it isn't a standard anymore.

    You could possibly stick a GUI over /etc/sysconfig but that isn't something I would use. If they decide to make it truly GUI then they better make sure it isn't needed or give textfiles less attention.
    • I am sure the *BSD'ers and the slackware users think /etc/sysconfig and /etc/rc.d/init.d are the cat's pajamas.

      /etc/rc.d/rc.inet1 is great. Setting up a new network interface is easy.

      /etc/rc.d/rc.inet2 is also very easy. No need to figure out what should be run to start bind or ..wait a minute. Its been a while since I ran qmail (can't stand it) but I wasn't aware that there was a requirement or even a provision for things to be started in init.d. Whatever, I don't like SysV.

      And that's the whole point. I don't have to like SysV, cause its *nix. I can do it anyway I like. Let's make sure we don't forget that. What's next, different GUIs for different unices? So much for standardization.

      SealBeater
  • Ximian Setup Tools (Score:3, Interesting)

    by Radagast ( 2416 ) on Monday February 18, 2002 @07:32AM (#3025765) Homepage

    The Ximian Setup Tools [ximian.com] do basically what's needed here. Sure, the GUIs themselves are tied to GNOME, but the backends are pure Perl with no other dependencies, and they convert the local configuration format for a number of platforms to and from generic descriptive XML. So whatever frontend could be built on top of this without worrying about the details of the platform.

    There are already tools for setting the system time, network configuration (with dialup), X configuration, fonts, DHCP, internet connection sharing, shares (Samba and NFS) and boot configuration, and they work on several versions of Red Hat, Mandrake, SuSE, and Debian, with some tools tentatively ported to FreeBSD, if I remember correctly.

    Last I heard, the KDE people were going to use the same backends for their config tool suite, but I'm not sure what happened to that. Creating a web frontend along the lines of Webmin would also be trivial.

    Now, of course, since the XST XML format already exists, it would be pretty trivial for most programs XST can configure to just gradually migrate to this XML format as their native configuration format. It's even very easy to support both at the same time (just use whatever is newest, and generate one from the other).

    In a perfect world, this would happen. In this world, however, I'm not so sure. In the meantime, XST offers very nice GUI tools for doing common GNU/Linux system configuration.

    • >The Ximian Setup Tools [ximian.com]

      Wow, this sounds like a good idea.

      Taking this idea and getting rid of the GNOME and Perl dependencies (i.e. rewriting the system :-) could make it more generally useful. GNOME has its good ideas, but I've found it to be too flaky in the past. (I use KDE.) I prefer not to have hacked out perl scripts on my system either. I'd much prefer Python for scripting XML manipulation. I suppose one could compromise and allow multiple scripting languages, if the basis is XML. I'm assuming you want to provide some higher-level configuration access libraries for each scripting language.

      For the XML, it would be better to use RDF which would hopefully allow the data to be more easily queried/interpreted by tools. The XML in the XST whitepaper is pretty useless, other than being human readable.

      -Kevin

  • Why fix it? It's good right where it is.

    I /like/ having daemons and programs having their own configuration file. I like having to be able to manually configure something and fix it myself, without having to fight with some meddling front-end. I like learning how configuration is done with each program. I like applying existing text editing and stream tools to work with configuration. This is the way it should be done, and this is why I like Unix far more than other OS's that aren't predominantly CLI-based.

    Don't fix it. It's not broken. Things work great as they are now. It's not difficult if you want to learn how to do it. Your "Unix Configuration Nightmare" is actually an elegant symphony of applications, clients, daemons, sockets, and streams that is UNIX. Take it or leave it.
    :)

    And you know, when I was your age... wait, you get my point.
    • I beg to differ. While I like Unix, I would not call this "great":

      ls -a $HOME
      .Xdefaults .Xmodmap .Xresources .addressbook .addressbook.lu .bash_history .bashrc .dayplan .dayplan.priv .dvipsrc .emacs .exrc .gimprc .grok .holiday .hotjava .jazz .kde .kermrc .lyxrc .muttrc .nc_keys .pgp .pinerc .profile .seyon .signature .ssh .stonxrc .susephone .tex .uitrc.console .uitrc.vt100 .uitrc.vt102 .uitrc.xterm .urlview .vimrc .xcoralrc .xfm .xim .xinitrc .xserverrc.secure .xsession .xtalkrc
      You get the idea...

      Sure, wget has a command line option for my http proxy. But why isn't there a system-wide default that it uses?
      Wait there is! But is it $HTTP-PROXY? Or $HTTPPROXY? Or $PROXY?
      What's my default printers name? Yeah right it's probably $PRINTER, but then again, maybe not.

      Sorry man, but I don't call that good. I call it ugly. Using an Apple, now that is pretty, and for a reason. Thinking about merging pretty (Apple) and powerful (Unix) sounds truly appealing to me.
      The article was talking about user configuration as much as server configuration. I could live with seperate conf files for servers, but for user conf files it's just plain ugly.


      • Sure, wget has a command line option for my http proxy. But why isn't there a system-wide default that it uses?
        Wait there is! But is it $HTTP-PROXY? Or $HTTPPROXY? Or $PROXY?


        Actually it's $HTTP_PROXY. Its called reading the documentation, which is why its there.

        As for things like .bash_history, .bashrc, .ssh, .signature, etc

        its called multi-user enviroment. Keeping individual settings, information and the like in $HOME is actually pretty elegant. How do you propose keeping seperate users settings intact? If its one system-wide configuration, obviously everyone is stuck with root's preferences, a bad idea I am sure everyone can agree.

        SealBeater
        • Read my comment carefully.

          This is not about a system wide conf file for all users. It may be about a single conf file for each user (in their respective $HOME). Of course that would make perfect sense.

          And it's not about how the environment variable is called either. Of course I can look that up in the program manual. It's about the fact that the variable is not standardized across different programs (which I was trying to illustrate by giving it different names). So one program may call it $HTTP_PROXY, while another may call it something else. And one program may expect it's value to be a URL, while another may want to cover more info, e.g. avoid the proxy for certain domains.

          The point is that such config info is not standardized across several different apps, so you may end up changing several different config files for one setting. That's the problem.

    • by Shanep ( 68243 ) on Monday February 18, 2002 @09:01AM (#3025975) Homepage
      that is UNIX. Take it or leave it.

      I agree. I'm reading all this wondering why people are complaining so much. How much time do people spend in /etc anyway?

      I need to get something set up, I go to /etc and either see a file or directory named something along the lines of what I'm configuring. Get it up and if I don't know it well, either quickly read the comments or the blah.conf man page... configured... working... I'm done in here for a while until I think of some other cool thing to do.

      When Win95 went to a single, non-text config file (registry), I instantly thought this was going to be a really bad move. And it proved to be. Registry rot is incredible. Anyone ever notice that if you reinstall Windows about once every year or so, you get a massive boost in performance? I installed 98 the other day (just for D2:LOD, Starcraft and RainbowSix), it boots (PII-300, 512MB) in about 30 seconds and shuts down in 1-2 seconds. Prior to this, 98 was taking an age, *if* it would shut down at all, and I had all sorts of stability problems. BTW, I put the C: on a 700MB partition and used a D: of 2.5GB for the games. I burn the C: to a CDR and when things get bad, just dd it straight back to hda1.

      My point is (back to the OSes that are more fun than a Frost Nova up Andariels arse), *I* want to mess with those config files, rather than have some app(s) messing with one really important file.

      I like it too.

      • *I* want to mess with those config files, rather than have some app(s) messing with one really important file.


        You're right about the registry, but a better designed system can give you the best of both worlds. Mac OS X's plist files are human readable and writable, easily accessible via a standard API (1 line of code to get or set any property), and do not involve a single point of failure.

  • by Anonymous Coward
    I've been thinking about this for a while and definately think that there needs to be various elements to a Unix configuration system:

    1) The concept of local and group configuration. There needs to be a Meta config file that specifies what individual users can and can't configure. So for instance, if a company wanted to allow users to configure their word processors however they wanted, exect that they couldn't make any changes to the dropdown menu of corporate document templates, that would be specified in the Meta file.

    2) A configuration server. I see no reason why this couldn't work with http to deliver XML config files to individual workstations. The Meta files could reside on the server, the local files on the hard disc. You could imagine in this senario that in order to configure your machine all you would have to do is enter the appropriate URL and press go:

    http://intranet.company.com/configs/standard.xml

    Then you could have different configs for different types of staff, and supported and unsupported configs (from the point of view of IT support).

    You could also perhaps have 'approved' config files for supported hardware.

    Having this type of Meta config file also allow IT support to have a clear idea of all the hardware used.

    I know that probably lots of people on Slashdot don't like the idea of IT support having control over the config of their machines, but big companies like it and if Linux is going to conquer the desktop then this is the type of tool that will help get it there.

  • It's the revenge of the geeks. A mindset, not a technical issue. If you cannot figure out how to configure the OS the geeks wrote, you do not deserve to be using it.

    In an interview of an IBM director, I asked why their then current OS had no GUI (when Windows was chipping at the userbase). Reply:
    We do not need mice - We are not children !"


    Mindsets change - at the speed at which glass flows :)

  • by heideggier ( 548677 ) on Monday February 18, 2002 @07:48AM (#3025813)
    Would it be possible to get rid of dotfiles? While alot of people like them I don't know why you couldn't have a ~/etc in the home dir. I get lot's of weird looks when I say, you keep all the configurations in /etc but user config's in dotfiles. There's must be a good reason for this could someone please explain

    On that thread what the hell is /usr/etc used for, or /usr/local/etc? won't it make more sense to move /etc here instead?

    Do we really need a central registry type file like the article proposes, surly isn't a front end enough, I can't understand what difference this would make. Having a central file which contain's everything like System.dat seem's to be a major security floor in windows since if you can crack that file you pretty much have root on the machine. Not being able to set different permissions for something like fstab or shadow would be pain. Although to be fair the article proposes it as a backup. If it ain't broke don't fix it.

    Apart from these questions I think that this was a pretty good/fair article, although I thought that it was a bit unfair to compare linux to windows/OSX since they are completely different OS and something like creating a central config app might work to make linux less customisable IMHO. Most distro's tend to have app's along these lines anyway, what the hells wrong with DrakConf?.

    • These is no technical requirement for dot files. If the entire community decided to standardise on ~/etc, it would happen.

      The general theory of /etc, /usr/etc and /usr/local/etc is quite simple. System configuration goes into all of these directories (no user config). Configuration needed at bootup goes into /etc. Configuration needed for OS-default applications goes in /usr/etc, which is available once /usr (containing the OS-default applications) is mounted. Configuration for application you have installed specific to your system (stuff that should be in /usr/local) goes into /usr/local/etc.

      The article is not proposing a central configuration file, but a standard for configuration. That would be like saying all application MUST store their configurations in a specific directory, and they must all use the same file format (say XML). Storing all configuration files in the same directory is not the same as storing all configuration in one file.

      The benefit of a common location and format is that every app or admin knows where to look for files, and how to interpret them. The structure of each file is identical, so you don't need to know if you use #, //, ' or $ for comments, and whether each line must start with a TAB or end with a ; . What each file says is still different, its just how it says it. Currently trying to work with config files on Linux is like being in a building and trying to talk to people, but everyone is in a different room and talking a different language. Standardize the language and the location, and you only have to content with understanding what is being said.

      Incidently, system.dat is not a security problem. In Unix terms that file is r/w by root only, and access only occurs through a kernel-level API. So "cracking" system.dat is no more or less hard than "cracking" shadow.passwd .

    • On that thread what the hell is /usr/etc used for, or /usr/local/etc? won't it make more sense to move /etc here instead?
      /usr/local/etc exists because you screwed up when you configured the package, by not properly adding the autoconf --sysconfdir=/etc flag, which is assumed if you also use the --prefix=/usr flag.
  • by Eloquence ( 144160 ) on Monday February 18, 2002 @08:09AM (#3025853)
    I had some similar thoughts when I posted this [google.com], which describes a system that would be capable of reading and writing various configuration files and at the same time try to establish a common configuration file standard. The idea is not new, a lot of similar attempts have already been made. I think the only way this can be successful is through massive collaboration in writing filters to support existing config formats. This means that the filters themselves have to be fairly simple (possibly even simpler than something like perl or awk, but everything should be supported), and that the configuration manager, as the Freshmeat author calls it, should offer direct access to the filter library so that you can easily add modules to support new programs.

    There's lots of cool stuff you can do with standardized configuration files, and dynamically generated GUIs are only one part of it. But developers are not going to change their file formats unless there's a real push for a specific format. Thus, to establish any format, you first have to develop lots of filters to support legacy software. As the FM author correctly points out, such a system would make software configuration under *x potentially much easier than under Windows.

    Finally, to all the hackers who fear that this will take away their file-meddling options: If properly implemented, it won't -- and if it does, it will not get accepted as a standard, exactly because of stubborn people like you :-)

  • maybe the community should agree about common human interface or at least about a common configuration file interface so a kde/gnome/... app can be written using the data for providing an easy setup tool.

    i think it would be a good addition to the linux standard base
  • by phaze3000 ( 204500 ) on Monday February 18, 2002 @08:17AM (#3025864) Homepage
    As someone who has used Linux for some time, and also had the misfortune of using Windows (and doing those MCSE things for all my sins), I can honestly say that I don't think the configuration is the problem. The varying standards used by programs aren't a particular problem as long as there a decent comments in the file (and there usually) are.

    The real issue is finding the configuration file; if you're using a distro you're not used to, then one often has to resort to using find. This is exactly what the Linux Standards Base [linuxbase.org] was designed to avoid, and if all distros were to follow this model then I can't see that there is any real problem.

    At the end of the day, we're not talking about things like setting background pictures in the window manager, we're talking about setting up mailservers, webservers and the like. If you're not cluefull enough to edit a text file then you're not cluefull enough to be put in charge of setting one of these servers up either.

  • by lcracker ( 10398 ) on Monday February 18, 2002 @08:17AM (#3025866) Homepage
    Yes, I know this is a comment on freshmeat (I wrote it).. but it pains me to see so much incorrect/incomplete information here that people just believe for lack of experience with OS X.

    ---

    MacOS X's solution to this problem is a couple levels
    deep. There are three (?!) systems for configuration:

    (1) /etc (which is a symlink to /private/etc):
    It's still there, used for a few things. But not much.
    More or less just stuff that runs before everything else,
    or stuff that apple doesn't have much control over, like
    Apache.

    (2) Netinfo database:
    basically takes a lot of stuff out of /etc and puts it in a
    "registry", this registry is accessible over a network
    connection for remote administration and such. You
    can also do some funky server/client stuff with this too.
    There's a command line interface to it that lets you
    read/change 'keys' and also dump out certain keys in
    well known /etc style formats

    (3) Property Lists (.plist):
    This is the way that just about all configurable
    information in MacOS X is stored. There are a couple
    different kinds of plists that the Core Foundation
    libraries understand, but the most prevalent of which is
    the XMLified version, the others are either vestigal or
    are used primarily for localization of strings. Every
    application (well, bundled app) on the system has an
    info.plist file that has application settings that the OS
    reads from on app startup, but you can also put your
    own tags in there. Applications also have the option of
    putting their own tags in the Resources subdirectory in
    their bundle, which is the preferred way. OS specific
    preferences (requires admin privs) go in /System/
    Library/Preferences, System-wide app preferences go
    in /Library/Preferences, Network-wide app prefs (only
    applicable if you have OS X Server on the network) are
    in /Network/Library/Preferences, and User app prefs go
    in ~/Library/Preferences.

    The Core Foundation framework manages more or less
    all of the work. They'll find the plist for you, let you
    work with the data structures, and serialize/deserialize
    it to plist format. It's really quite nice to use. Just
    about all of the data structures in Core Foundation are
    serializable, even the property list data structures, so
    sometimes you'll see property lists with serialized
    property lists inside them.

    As far as unified configuration interfaces go, there
    really isn't a need for any in Mac OS X.

    You're on your own with /etc, as nothing there is meant
    to be novice-tweaked anyways (In OS X).

    There is a GUI NetInfo Manager and command line tools
    to configure the stuff in that database (nothing a
    novice needs to touch).

    Configuring the plists is primarily done inside the
    applications that you use (since it's so easy for the
    developer to use Core Foundation to read/write
    property lists), there are no separate configuration
    programs, but there are command line tools for working
    with plists. If you're using the developers kit, you get a
    little (not very poweful and pretty inefficient) program
    to edit plist files graphically, but otherwise you either
    do it by hand with a text editor or the command line
    tools and risk breaking things or let the apps take care
    of it themself.

    BTW, all of the Core Foundation stuff is available in two
    flavors: C, and Objective C. The C libraries are pretty
    straightforward and work in all situations, but if you're
    writing an app using the Cocoa framework in Obj C, it's
    way easier.. though there are a few little peculiarities
    about the Obj C implementations. The bonus is that
    you can use both at the same time, and Core
    Foundation types / Cocoa instances are interchangable
    by some voodoo that Apple did. If the Cocoa
    implementation doesn't work right (As with serializing a
    plist that has NSNumber Boolean types), you just use
    the Core Foundation implementation and a typecast..
    voila, one line of code changed and everything is
    happy.
  • by weave ( 48069 ) on Monday February 18, 2002 @08:46AM (#3025948) Journal
    Having had to administer both windows and multiple unix server, some thoughts (and since I'll be negative to both platforms, it guarantees zealots from both sides will flame me, bwahahahaha)
    • The registry in Windows seems to be a logical choice. There are standard tools to use it, it can be manipulated remotely, and except for those horrible clid crap. It is, however, difficult to understand for a human except for those common areas like HKLM\Software\Microsoft\Windows\Run.
    • The Windows registry implementation is horribly flawed. It's too likely to get corrupted. A lot of this is from being part of a roaming profile [ntbugtraq.com]. Losing your registry is like losing all of your application's and user preferences. It really sucks.
    • *NIX is a mess when it comes to location of config files, as stated in the article. Even various Linux distros. We have Redhat boxen doing a lot of work now, having switched from a proprietary UNIX (dg/ux) a while back. Some of my techs think we should switch to Debian. I installed it on my workstation in vmware. It's nice, but it'll just require re-learning where the hell everything is. Maybe no big deal but I've got too much to remember already.
    • Windows registry trees are not commented. You need to know how to find various reg hack [jsiinc.com] sites and own a ton of resource kits, just to keep a leg up on the crap. Even then everything is not revealed. "You should configure it through the GUI." Yeah, right, on 2,000 machines?
    • UNIX config files generally only have one per app. Configuring an app is simply a matter of loading the config file into an editor, reading the including commentary, and adjusting to taste. The exception here is the redhat /etc/sysconfig tree where everything is basically just loading of env vars for other scripts. Not commented, minimal defaults, if you need to figure out something it's dig through docs or read the rc scripts yourself to figure out what to set in it. Yack...
    • Windows configs are often done through a maze of menu entries, dialog boxes, tabs, "advanced" buttons, etc... It always leaves you wondering if you've convered everything...
    • UNIX config files are easily replicated to another box for a poor man's backup/failover situation. I had a 2000 server in a SAN go down and while I could easily mount that boxes disks into another 2000 server, moving the printer and file shares over was a problem because that shit is all stored in the registry. Instead of a simply copy command, I'd either need to write some sort of program to extract and merge into the backup's registry or figure out another way to replicate the shares. Keeping config crap out of a common database means the service isn't tied to a box so much. Need to move it to another box? Install, copy config files, change a virtual DNS name to point to new location.
    • Windows registry is horribly insecure, not by design, but implementation. Loads of apps insist on writing per-user stuff to HKLM during runtime. I should be able to make HKLM r/o for all users but if I do that, shit breaks horribly. Damn it, HKLM should only be scribbled into by an application during its install process.
  • by cobar ( 57479 ) <maxwell@101freeway.com> on Monday February 18, 2002 @08:54AM (#3025968) Homepage
    This would be really nice for allowing configuration utilities to work on programs they've never even heard of. Imagine for a moment, that the developer of an application provides lots of useful information for each configuration option, such as the level of importance of an option, comments and descriptions, web links, the data type of the variables, etc. in a xml template file that comes with the application. The template could then be queried by whatever tool you're using and provided you have enough info linuxconf, web frontends, dialog apps, etc. could all build an interface by simply reading all those options from the template via some kind of library function.

    Likewise, changes to the config could be passed through the library functions, get validated for correctness and then written to disk in whatever format you want. The level of functionality would be such that you could generate white space delimited files, xml configs, or whatever you want and because the template is descriptive enough, comments could be inserted/preserved for those editing with vi.

    Now that I think about it, this really wouldn't a rewrite of existing applications, they could simply keep their existing formats and build the template file for other config utilities. Then, if at a later date they decide to drop their own config processing, they use the template driven library to do the processing work. That way backward compatibility could be maintained.

    This does nothing to reduce the myriad different configs that you deal with when editing by hand, but it would give the authors a chance to move a more common format later on down the road. And I think it is more useful than trying to get everyone to switch to some unified format that appeases new users.

    I have half a mind to try a limited version of this out for handling Apache virtual domains. And it's a lot more fun than hard-coding a parser into your frontend.
  • A few things (Score:4, Interesting)

    by HalfFlat ( 121672 ) on Monday February 18, 2002 @09:08AM (#3025989)

    The current system for starters isn't too bad - the configuration files for important system tools are typically well documented (in man pages if nowhere else), and aren't too hard to edit in a text editor. Certainly there is a problem with the use of automated GUI tools for system configuration, but I can't really see why GUI tools are so important.

    Consistency though would be a nice thing, if only so that as more programs are used and require configuration, we don't all have to learn more and more ad hoc configuration schemes. There is the potential for the current system to get well out of hand. Consistency is nice from an aesthetic point of view - ad hocery is rarely pretty.

    Tools such as linuxconf or webmin don't help the problem, they just obscure it. Often badly! (Don't get me started on linuxconf, ugh!)

    The earlier suggestions of XML, or a recognised subset of XML, together with XML schema to describe the formats, seem ideal as far as file formats go:

    • It's standard and well-documented.
    • There are a large number of parsers that work with a useful large subset of XML, for many platforms and languages.
    • In a pinch, it's not hard to write a quick and dirty and correct-enough parser from scratch on an ad hoc basis, to parse your own particular XML-based configuration files.
    • It's human editable (or should be, if used wisely).
    • It is rich enough to encompass all the text-format configuration files currently in common use (under the Linux-based operating systems I know of at least).
    The big problem of course is inertia: changing configuration files is a big change! Personally, I think the cost though would be worth it in the long term.

    The important thing to me is that there is no API specified as mandatory. While a standard API for accessing and manipulating configuration data would be nice, requiring it to be used will not only make adoption of a standard config format slower and harder, but will also limit software developers to the tools for which the API has an implementation. I'd go for:

    1. Use XML + schema as the mandatory config file format in the new scheme.
    2. Have a preferred mechanism for signalling to applications that configuration data has changed (eg SIGHUP) so that changes can be made atomically.
    3. Provide an API for manipulation of config data, but only as a convenience to developers and automated config tools.

    I also agree with the earlier comment promoting the use of ~/etc over dot-files. Makes good sense! Again, it's only inertia that will make such a change difficult. Though if other changes are going through ... in for a penny, in for a pound!

    Lastly, whatever scheme is adopted, it seems to me essential that there be some flexibility in where the configuration files are located. Standard places are important, but there must also be some way to say to an application that their config data is in /usr/local/etc, or in /opt/package-name/etc, or wherever. This is necessary for sane package isolation and management, especially if not all software on a system is maintained by someone with superuser priveleges.

  • It took this long? (Score:5, Insightful)

    by Ageless ( 10680 ) on Monday February 18, 2002 @09:21AM (#3026026) Homepage
    It took MacOS X for people to realize that this was a problem in UNIX? Please.

    The reason UNIX and UNIX applications are hard to configure, in most cases, is because Open Source programmers are lazy.

    This is obviously a blatent generalization so I will explain.

    The old adage is that an Open Source program gets written when a programmer has an "itch" they decide to scratch. The problem is that very few people are itched by configuration. You may write the best web server in the world (Apache!) but by time it comes to writing the configuration manager for it the volunteers start falling away.

    It isn't very fun writing a bunch of dialogs, windows, buttons and such to make a nice configuration for a program. It's kinda like documentation (and we all know the state of docs for many UNIX programs).

    I see examples of this every day. I have a Mac OS X using friend who sends me the URL of every new program he decides to use. It's incredible how many of them are UNIX ports with a beautiful configuration manager stuck on. Mac programmers hold themselves to a higher level of user experience and UNIX people need to get on the boat.

    What's needed isn't a global, all dancing, all singing configuration system. What is needed is responsibility in programming.

    P.S. Everyone always whines about the Windows registry because it's binary, you can't edit it blah, blah, blah... But the fact is: It works. The average user never cares to edit it because they config their programs from WITHIN their programs. If something is truly needed, do the Windows registry in text file format. Make it /etc/registry.conf. There is no reason it has to be binary.
  • Making *NIX systems easy to configure maintain, manage and etc will be the downfall of the IT industry, Green Skinned *NIX admins everywhere will revolt the people tring to bring *NIX to the masees.....

    Alright so im joking...big suprise...

    I think this would be a good thing all in all, IF they DONT MUCK with my existing configurations. There are many things that can be tweaked far beyond the iditot proof gui configuration tools on other OS, In windows you can resort to registry tweaking for some items, others you just cant do a damm thing about, its those thing Im afraid will be removed from my control.

    Dummning down on the surface is fine, as long as they dont do it to the underlying configurations. I still cant figure out how the hell to edit (or find) the samba configuration file on OSX, Now granted its not my machine, and I dont really use BSD, so im not suprised. But does it even exist ??? A I am used to it on Solaris and Linux ?

  • No XML is not suited for this. XML is not a panacea. XML is for representing large amounts of structured data whose primary purpose is to be interpreted and transformed, and frequently eventually presented to some user. The semantic, syntactic, and performance overhead of XML is WAY too great.

    Instead we just need a simple text-only configuration file format which has support for a hierarchy of values (this gets you pretty much what XML would give you). It would also be nice if the format was position-independent, so it could be streamable. A proposal was posted somewhere, but now I cannot find the link. The format could be as simple as:

    toplevelkey=value
    [tab]branchname1
    [tab]branch-key1=value
    [tab]branch-key2=value
    [tab][tab]branchname2
    [tab][tab]branch-key3=value

    you get the idea. Please don't throw XML into the mix, it will not simplify things.
  • I think most of us agree that the conf system is getting out of hand. With the proliferation of distros, its only going to get worse.
    A solution would be to first implement a generic "configuration" library. A small, efficient library with various language bindings. It should provide the coder simple functions to manipulate the conf file, sortof like "getopts".
    Once the above library is implemented, encourage people to use it in any new projects that they are starting. At the same time, volunteers (ie you) can work on "porting" the existing packages over to using this new fangled library.
    Over time, this approach should work.
  • by Tony Hammitt ( 73675 ) on Monday February 18, 2002 @12:26PM (#3026874)
    We should use actual Python code as the configuration file format. It's callable directly from C, and by extension, all other languages. It's nice and clean. It supports heirarchial inclusion of other configuration files. It has easily readable comments. In short, it's the perfect configuration file specification language.
  • by Animats ( 122034 ) on Monday February 18, 2002 @02:45PM (#3027676) Homepage
    Putting a GUI front end on a mess merely results in a less understandable mess. The problem needs to be fixed. Here's how:
    • Avoid configuration wherever possible. If something can be discovered, it shouldn't have to be configured. This applies to most pathnames. Searching directory trees is faster than it used to be. Long-term, a database of where stuff is is needed. Note that Microsoft is going that way.
    • The PATH approach to program finding has to go. It leads to everything being in a small number of /bin directories. Each installed program needs to be in a separate directory subtree. /bin directories should consist only of links.
    • Separate preferences from configuration. Individual user preferences should be disposable; if they're missing, the defaults apply. The old MacOS worked that way.
    • There are several categories of programs. Ordinary applications should be installed in a separate directory subtree for each program. The subtrees should be organized something like the Windows approach of "program files/vendor name/app name/". For ordinary applications, no interaction is allowed between apps at install time, and a standard installer should enforce this. That way, installing A can't mess up B.
    • Programs that aren't "ordinary applications" should be given some identifying name, so users are warned that they may mess things up. This will discourage unnecessary tweaking during installs. All games, for example, should be ordinary applications. Programs that mess up other programs' installs should require more privileges to install than those that don't.
    • Hardware should be recognized via discovery, period. Support for hardware that can't be discovered should be dropped.

    We will now hear from all the people who insist that "they have to do wierd thing X because it's (traditional) (k00l) (needed to support their 386 machine)". They're wrong. Someone needs to be a hardass and fix this thing.

"If it ain't broke, don't fix it." - Bert Lantz

Working...