[augeas-devel] [Fwd: [Puppet Users] Re: Augeas and grub.conf]
Matthew Palmer
matt at anchor.net.au
Fri Aug 7 02:09:16 UTC 2009
On Thu, Aug 06, 2009 at 05:49:19PM -0700, David Lutterkort wrote:
> On Fri, 2009-08-07 at 07:26 +1000, Matthew Palmer wrote:
> > > 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.
>
> I am not a big fan of putting a notion of 'symlink' into the tree data
> structure since it complicates internals considerably (dangling symlinks
> after you delete the target file in the tree, evaluation of path
> expressions etc.) and doesn't solve the issue at hand any better, since
> there's no /etc/grub.conf in Debian anyway.
You're never going to be able to solve the "different files in different
distros" problem in general, so I wouldn't try (leave that for Puppet or
whatever). Dangling symlinks are a problem, but how are you dealing with
files disappearing out from underneath Augeas in the middle of a run at the
moment? Presumably similar handling could be performed for symlinks.
> I'd much favor a solution that would add some sort of bidirectional tree
> <-> tree transform that simply renames the tree so that it always
> appears in the same place, no matter what OS you're on. But that's not
> all that simple, either.
Especially when you consider that there's plenty of lenses that don't have
the concept of a "single file", like the ones that handle /etc/sysconfig or
/etc/default files... I think that way lies madness.
- Matt
More information about the augeas-devel
mailing list