[Ovirt-devel] [PATCH ovirt-node] Adds automatic non-interactive configuration for the standalone node.

Jim Meyering jim at meyering.net
Mon Nov 17 16:24:21 UTC 2008


David Lutterkort <lutter at redhat.com> wrote:
> Morea question for Alan:
>
> On Mon, 2008-11-17 at 13:28 +0100, Jim Meyering wrote:
>> Also, how about performing the network restart only if augtool etc.
>> succeeded? [this also factors out another $config]
>>
>>     {
>>       config="$WORKDIR"/config-augtool
>>       { cat "$WORKDIR"/augtool-* && printf "save\n"; } > $config \
>>         && augtool < $config \
>>         && service network restart
>>     } >> $CONFIG_LOG_FILE 2>&1
>
> Why not pipe straight into augtool ?
>
>         { cat "$WORKDIR"/augtool-* && printf "save\n"; } | augtool

The reason is actually sort of subtle.
If somehow cat or printf malfunctions (I/O error, ENOMEM) or is killed,
the nonzero exit status won't propagate out, and augtool may be happy
to parse the incomplete input.  Then we'd restart the network, yet with
incomplete config changes.  That might be a hard one to diagnose.

> Also, would it help if augtool had an option that appends a 'save' to
> any commands read from stdin, so that you could say
>
>         for f in "$WORKDIR"/augtool-*; do; augtool --save $f; done
>
> Or not worth the trouble, especially when it comes to checking errors ?

Not worth it, IMHO.




More information about the ovirt-devel mailing list