Hi all,
As I was working to fix ticket #109 on RPC service lines in inetd.aug (see
my previous email for the patch and comment), I went to look at the
xinetd.aug lens to see how it's mapped there, since I believe there should
be a consistency between inetd.aug and xinetd.aug.
In xinetd.aug, services are mapped using key instead of a "service" label,
just as in inetd.aug currently. The result is that the tree can look like
this (this part is from the test module for xinetd.aug):
{ "#comment" = "default: off" }
{ "#comment" = "description: The CVS service can record the history of
your source" }
{ "#comment" = "files. CVS stores all the versions of a file in a single"
}
{ "#comment" = "file in a clever way that only stores the differences" }
{ "#comment" = "between versions." }
{ "cvspserver"
{ "disable" = "yes" }
{ "port" = "2401" }
{ "socket_type" = "stream" }
{ "protocol" = "tcp" }
{ "wait" = "no" }
{ "user" = "root" }
{ "passenv" { "value" = "PATH" } }
{ "server" = "/usr/bin/cvs" }
{ "env" { "del" } { "value" = "HOME=/var/cvs" } }
{ "server_args"
{ "value" = "-f" }
{ "value" = "--allow-root=/var/cvs" }
{ "value" = "pserver" } }
{ "#comment" = "bind = 127.0.0.1" }
{ "log_on_failure" { "add" } { "value" = "HOST" } } }
I'm not a big fan of this, because you end up with nodes that have variable
names, and no value. In that case, the node name is "cvspserver" and there
is no value associated to the node.
This makes it quite difficult to make requests such as listing all services,
since you have to list all nodes that are not "#comment". It's all the more
difficult in inetd.aug if we used special nodes like "#address" and "#rpc"
since we have to list the nodes that are not "#comment", "#address" or
"#rpc". Using a label instead of a key would make all this much easier,
since you could just request all the nodes called "service". Furthermore, it
wouldn't change the structure of the tree at all, since the value currently
used as the node name (using key) would become the node value (currently
unset), hence having:
{ "#comment" = "default: off" }
{ "#comment" = "description: The CVS service can record the history of
your source" }
{ "#comment" = "files. CVS stores all the versions of a file in a single"
}
{ "#comment" = "file in a clever way that only stores the differences" }
{ "#comment" = "between versions." }
{ "service" = "cvspserver"
{ "disable" = "yes" }
{ "port" = "2401" }
{ "socket_type" = "stream" }
{ "protocol" = "tcp" }
{ "wait" = "no" }
{ "user" = "root" }
{ "passenv" { "value" = "PATH" } }
{ "server" = "/usr/bin/cvs" }
{ "env" { "del" } { "value" = "HOME=/var/cvs" } }
{ "server_args"
{ "value" = "-f" }
{ "value" = "--allow-root=/var/cvs" }
{ "value" = "pserver" } }
{ "#comment" = "bind = 127.0.0.1" }
{ "log_on_failure" { "add" } { "value" = "HOST" } } }
This is generally the kind of tree I make in the lenses I write, and I could
just suggest patches for the lenses where this might be a problem (such as
inetd.aug for example), but I would like to raise the issue to talk about
setting a policy for this, so as to prevent tree breakage in the future
(like it's likely to happen with inetd.aug to support RPC service lines).
What are your thoughts on this?
Raphael
_______________________________________________
augeas-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/augeas-devel