[augeas-devel] Transparent update of files with cross-filesystem links

David Lutterkort lutter at redhat.com
Tue Aug 11 00:56:49 UTC 2009


On Fri, 2009-08-07 at 20:05 -0500, Nathaniel Griswold wrote:
> I was considering patching augeas to just make this completely
> transparent. In other words, wouldn't it be possible to just create
> the temporary file on the target filesystem and perform an atomic
> rename? I'm wondering if there is any reasoning for not going this
> route.

You get the same failure for bindmounted files; in that case, you won't
be able to identify the target filesystem (short of trawling
through /dev), so you'd still need the copy_if_rename_fails.

For symlinks though, we could first try and go through one or more
readlink's and attempt to create the .augnew there. You'd have to be
careful though that different save modes are handled correctly: in
particular when the save mode is AUG_SAVE_NEWFILE, you want to
produce /etc/grub.conf.augnew - when it is not, you want to write
to /boot/grub/grub.conf.augnew and do the rename.

Looking forward to patches ;)

David







More information about the augeas-devel mailing list