[Ovirt-devel] [PATCH] Allow persistance of empty config files in ovirt_store_config

Alan Pevec apevec at gmail.com
Thu Mar 25 13:28:54 UTC 2010


On Thu, Mar 25, 2010 at 1:41 PM, Darryl L. Pierce <dpierce at redhat.com> wrote:
>>                  # skip if file does not exist or is empty
if changing logic, comments...

>> -                if [ ! -s "${filename}" ]; then
>> +                if [ ! -e "${filename}" ]; then
>>                      printf " Skipping, file '${filename}' does not exist or is empty\n"
... and messages should be corrected

>>                      continue
>>                  fi


> ACK - I'll push this upstream. Thank you. :)

please hold with the push, soft nack from me for the moment, 0 size
check was explicitly  added in:

commit 9a0b8ceb94784402c4acf5a5c92dfa0397b76dd7
Author: Alan Pevec <apevec at redhat.com>
Date:   Sat Jan 31 00:12:47 2009 +0100

    do not persist empty files

    empty config files confuse applications which don't expect them
    e.g. empty ifcfg-* or ssh_host_*key

    Empty configs show up after storage is reformatted, leaving placeholder
    empty files in rootfs.

I need to check if that's still the case and find other solution.
BTW, one important thing about stateless persistence: rc.sysinit will
bind-mount only what's listed in /config/files AND if there's existing
file in rootfs.
mount_config, called in ovirt-early will also try to create target
mount-points in rootfs (this works if parent dir is in rwtab,
otherwise rootfs is read-only!)
but this might be too late in some case e.g. additional persisted
initscript won't be picked up since shell expansion
/etc/rc$runlevel.d/S* in /etc/rc.d/rc was already done.

So if you really need that the file exists, it should be included in
the RPM or at least created in kickstart.

Alan




More information about the ovirt-devel mailing list