also sprach Nicolas Valcárcel Scerpella <nicolas.valcar...@canonical.com> 
[2010.09.13.2030 +0200]:
> I don't understand the use case of this, why would you want to 'save'
> and that the changes aren't written to the disk? whouldn't that be
> unusefull?

The use case is puppet, which seems to use the equivalent of -n and
then compares the new file to the existing one. It needs to do this
to be able to atomically move the new file over the existing one.

Maybe my bug report was hence misleading. I suppose I wonder why
augeas can't determine up front (without doing changes in-memory),
whether a file will need to be changed.


also sprach Dominique Dumont <dominique.dum...@hp.com> [2010.09.14.0907 +0200]:
> > Augtool insists on writing to the filesystem, even if it does not
> > need to make any changes. For instance, the following fails because
> > /etc is mounted read-only, and hence /etc/ssh/sshd_config.augnew
> > cannot be written (strace attached):
> 
> For the record, sshd_config.augnew is not a temporary file. This file will be 
> written with whatever change you make. Augtool man page specifies this 
> behavior with the '-n' option:
> 
>        -n  Save changes in files with extension '.augnew', do not 
>            modify the original files

I did not use -n in my invocation of augtool.

> I guess that Augtool could be improved not to save the file since
> you did not actually change its semantic content. But you did ask
> for a save ...

Exactly: it does *not* change, so any subsequent change could be
a no-op. The question is whether augeas wants to be imperative ("I
said save, so save, even if there is nothing to save"), or borrow
some declarative notions ("the user wants the final result to be
such-and-such; since that is already the case, I don't have to do
anything when s/he issues the `save' command").

> By the way, what happens in your use case if the content of
> sshd_config is *actually* changed ? If /etc is read-only, any
> change will be lost. So what's the point of using augtool on
> a read-only file-system ?

Then I will get puppet errors mailed to me until I take the time to
remount it r/w, run puppet, and remount it r/o. This happens very
rarely since my puppet configuration is quite stable.

-- 
 .''`.   martin f. krafft <madd...@d.o>      Related projects:
: :'  :  proud Debian developer               http://debiansystem.info
`. `'`   http://people.debian.org/~madduck    http://vcs-pkg.org
  `-  Debian - when you have better things to do than fixing systems
 
uʍop ǝpısdn sı ɹoʇıuoɯ ɹnoʎ

Attachment: digital_signature_gpg.asc
Description: Digital signature (see http://martin-krafft.net/gpg/)

Reply via email to