Subject: XML for System Configs [ was Re: power management and related concerns ]
To: Garrett D'Amore <>
From: Chris Jepeway <>
List: tech-userlevel
Date: 07/05/2006 19:58:05
> Hmph.  Don't see sedpw, cshpw, etc.
Cuts both ways, I think: vipower => viprintcap and
vifstab and vittys and visshd_config and vissh_config
and viftpusers and vinetworks and viinetd_conf and...

The larger point lies in violating "one line, one semantic unit."
Unix cmd-line utils operate on lines.

I wasn't begging "gimme a wrapper around an editor
to save me from the complexity of the file format."
Sorry, that really wasn't clear in my prev msg.
My bad.

> Do we really think that any of these config files are likely to grow to
> the complexity _and_ the power where a simple edit by a human can't get
> one to a sane state?
Perhaps, perhaps not.  But please don't create the situation
where I've got to be able to run a full screen editor just
to see enough context so I can sanely alter a system config.

And if the format's going to remain simple...well...why XML, again?

> And, if necessary, we can provide some simple xml command line editing
> tools for use in scripting.  Possible example strawmen:
>     xml -get -d printcap -f /etc/passwd.xml "user=garrett" "gecos"
>     xml -set -d printcap -f /etc/printcap.xml "queue=lp"  
> "device=/dev/lp0"
I don't exactly hate this idea :).  Though, again, I think
if this kinda thing will work well, XML may not be required.

> I've also written awk and sed code that can manipulate certain bits of
> XML.  Its not hard to do at all,
Sure, sure, sure, but you've got to carry state across line boundaries
when you do so.  That's not as simple as "one unit of worry == one line
in a file."

>  but it does require a little more
> effort and its "hard" if the format is not constrained to some
> reasonable subset.  But things like password files could easily be
> constrained to a simple format that is a proper subset of XML, and then
> you _could_ use your shell-fu to hack on them.
Hm...even with one line, one worry, it'd be

	sed < /etc/passwd > /tmp/ptmp 


	sed < /etc/passwd > /tmp/ptmp 's/^root:[^:]*:/root:NO:/'

> I'm not a huge fan of XML,
Nor am I.

>  but your objections here sound like FUD
You name-caller, you :)

I s'pose, really, all I'm claiming here is that there's
a large installed base of super-snappy admins out there
who keep Unix boxes running 24x7, and that breaking off
their typing fingers by introducing XML every dang where
is a non-insignificant cost.

If you don't buy the claim, well, sure, I understand...

>     -- Garrett
Chris <>.