#721905 augeas-lenses: sysctl.conf lens reads too many files in sysctl.d

#721905#5
Date:
2013-09-05 09:01:17 UTC
From:
To:
Dear Maintainer,


I use Augeas in my Puppet manifests to control the contents of sysctl.conf.
After upgrading my workstation to jessie/testing I found I had a directory
/etc/sysctl.d and Augeas reads all the files in it (I'm not sure which of these
are new).
This directory includes a file named README.sysctl which sysctl does not read
according to sysctl.conf(5). That also fits with the content of that file
which is plain English. Augeas however does and complains about its contents.


Puppet logs messages like:
Debug: Augeas[enable forwarding](provider=augeas): Opening augeas with root /, lens path , flags 32
Debug: Augeas[enable forwarding](provider=augeas): Augeas version 1.0.0 is installed
Warning: Augeas[enable forwarding](provider=augeas): Loading failed for one or more files, see debug for /augeas//error output
Debug: Augeas[enable forwarding](provider=augeas): /augeas/files/etc/sysctl.d/README.sysctl/error/pos = 0
Debug: Augeas[enable forwarding](provider=augeas): /augeas/files/etc/sysctl.d/README.sysctl/error/line = 1
Debug: Augeas[enable forwarding](provider=augeas): /augeas/files/etc/sysctl.d/README.sysctl/error/char = 0
Debug: Augeas[enable forwarding](provider=augeas): /augeas/files/etc/sysctl.d/README.sysctl/error/lens = /usr/share/augeas/lenses/dist/sysctl.aug:36.10-.52:
Debug: Augeas[enable forwarding](provider=augeas): /augeas/files/etc/sysctl.d/README.sysctl/error/message = Iterated lens matched less than it should
Debug: Augeas[enable forwarding](provider=augeas): Will attempt to save and only run if files changed
Debug: Augeas[enable forwarding](provider=augeas): sending command 'set' with params ["/files/etc/sysctl.conf/net.ipv4.ip_forward", "1"]
Debug: Augeas[enable forwarding](provider=augeas): Closed the augeas connection


I expected the Augeas lens for sysctl.conf to ignore files not named *.conf in
/etc/sysctl.d.

Marking everything in README.sysctl in /etc/sysctl.d as comments with '#'
works around the problem.

Best regards
/Ulrik Haugen

#721905#10
Date:
2013-09-05 09:46:04 UTC
From:
To:
tags 721905 + fixed-upstream
thanks
https://github.com/hercules-team/augeas/commit/ac49161fb185f2cd3b0ad257e76f45aa8462d082

Other distros (such as RHEL 6) load /etc/sysctl.d/* rather than *.conf,
so we probably won't change this to *.conf upstream, perhaps until
systemd (which only loads *.conf) is in standard use.

#721905#17
Date:
2013-09-05 11:00:56 UTC
From:
To:
Fair enough, thank you very much!

/Ulrik Haugen