[augeas-devel] [Fwd: [Puppet Users] Re: Augeas and grub.conf]

Matthew Palmer matt at anchor.net.au
Thu Aug 6 21:26:40 UTC 2009


[Please don't Cc me on list replies; I read the list that's why I can post
to it]

On Thu, Aug 06, 2009 at 10:52:34AM +0100, Matthew Booth wrote:
> On 06/08/09 00:16, David Lutterkort wrote:
>> Here's the rub: we can't change the Grub module to look for both
>> menu.lst and grub.conf in /boot/grub, since on Fedora menu.lst is a
>> symlink for grub.conf, and we'd wind up loading the same file twice into
>> different places in the tree, with very weird behavior when you make
>> changes to both copies.
>>
>> We could add some sort of facility to distinguish between OS's[1] and
>> load one or the other, depending on OS. I am not perfectly happy with
>> this solution, since it requires that users check several places in the
>> tree where grub.conf could show up. Addressing that though would require
>> some work on mapping trees on load/save, e.g. by adding something to
>> transforms that expresses 'put the tree under /this/path/here instead
>> of /files/foo/bar'
>>
>> Also, if we change away from /etc/grub.conf on OS's where it currently
>> works, we'd break people's existing code (e.g. Puppet manifests)
>
> Could augeas be clever about this? If it indexed files by fsid/inode, it  
> could link parts of the tree that pointed to the same file. In the case  
> of a symlink it would obviously have to follow it to a real file.

I'm thinking that fully recognising and emulating symlinks is probably the
Right Thing To Do.  Basically, if a detected file is a symlink, then Augeas
remembers that, and any changes to the "symlinked" subtree actually happen
in the "real file" subtree.  When the tree is saved, the symlinked version
is ignored and the real file is saved to (which also nicely works around the
cross-device mv/link problem).

Whether that's more work than it's worth isn't my call, but that seems like
the "least surprise" method of handling the situation.

- Matt




More information about the augeas-devel mailing list