[augeas-devel] Sysctl and slashes

Raphaël Pinson raphink at gmail.com
Thu Nov 17 10:27:05 UTC 2011


Hello,


As I was trying to parse some of our sysctl.conf files some time ago, I
noticed that the Augeas was unable to parse them. Upon investigating the
issue, I found that "/" is a valid separator for fields in sysctl.conf, but
sysctl.aug only supports ".", e.g.:

net/ipv4/conf/eth1/arp_announce=1

is equivalent to

net.ipv4.conf.eth1.arp_announce=1


If I had found it in one or two files, that would be fine, but it seems
quite a lot of different sysadmins use the slash syntax.

Now the problem is: supporting "/" as a field separator is incompatible
with the way we currently map sysctl.conf in Augeas, because "/" is
forbidden in node labels.

One suggestion would be to map the fields as subnodes, somehow re-creating
the structure found under /proc/sys. So instead of mapping:

net.ipv4.conf.eth1.arp_announce=1

to

{ "net.ipv4.conf.eth1.arp_announce" = "1" }

as it is done today, it would be mapped to

{ "net" { "ipv4" { "conf" { "eth1" { "arp_announce" = "1" } } } } }

using a recursive lens.

What do you think? Should we support this syntax? Is it worth it to break
the compatibility for this lens?


Raphaël
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/augeas-devel/attachments/20111117/c9d9a09b/attachment.htm>


More information about the augeas-devel mailing list