[Ovirt-devel] [PATCH node] Bootup mounts the local log partition if it exists

Bryan Kearney bkearney at redhat.com
Wed Jan 14 15:23:52 UTC 2009


Perry Myers wrote:
> The logs-backup directory is just to catch any logs that get created 
> between the system starting and ovirt-early coming up, correct?  Should 
> be minimal messages and dmesg output probably.  Any way to get the log 
> partition mounted earlier than ovirt-early 


ovirt early runs very early (01), and mounting of the logs is done first 
in that script. I believe that minimizes the impact.

so that we minimize log
> discontinuity?  Also it looks like logs-backup directory is itself not 
> persistent.  So the early logs will always get lost.  Perhaps we should do:
> 
> cp -R /var/log /var/logs-backup
> mount /dev/HostVG/Logging /var/log
> rm -Rf /var/log/logs-backup
> mv /var/logs-backup /var/log

I will add that to the patch and re-send it.

> 
> That way the logs-backup is persisted at least for one boot.
> 
> Also, what about logs created during firstboot?  We need a patch that 
> makes it so immediately after the Node has the log partition created 
> from o-c-storage the log partition is mounted and logs in the 
> non-persistent log partition are moved over.  Otherwise we lose all of 
> the log output from the firstboot scripts.

Good catch..i will add that as well. Given the resolution above, these 
will be available for 1 reboot only. Unless we put in a rolling logic 
(keep logs for 3 reboots). Thoughts?

-- bk

> 
> Perry
> 
> Bryan Kearney wrote:
>> ---
>>  scripts/ovirt-early     |    1 +
>>  scripts/ovirt-functions |   20 ++++++++++++++++++++
>>  2 files changed, 21 insertions(+), 0 deletions(-)
>>
>> diff --git a/scripts/ovirt-early b/scripts/ovirt-early
>> index 153c0c7..53d5e21 100755
>> --- a/scripts/ovirt-early
>> +++ b/scripts/ovirt-early
>> @@ -113,6 +113,7 @@ find_disk() {
>>  
>>  
>>  start() {
>> +    mount_logging
>>      # oVirt boot parameters
>>      #   BOOTIF=link|eth*|<MAC> (appended by pxelinux)
>>      #   ovirt_init=usb|scsi[:serial#]
>> diff --git a/scripts/ovirt-functions b/scripts/ovirt-functions
>> index 9301678..1204231 100644
>> --- a/scripts/ovirt-functions
>> +++ b/scripts/ovirt-functions
>> @@ -196,6 +196,26 @@ mount_config() {
>>      fi
>>  }
>>  
>> +# mount logging partition
>> +mount_logging() {
>> +    if grep -q " /var/log " /proc/mounts; then
>> +        return 0
>> +    fi
>> +    #  backup the logs
>> +    if [-e /var/logs-backup ]; then
>> +        rm -rf /var/logs-backup
>> +    fi
>> +    cp -R /var/log /var/logs-backup
>> +
>> +    mount /dev/HostVG/Logging /var/log
>> +    if grep -q " /var/log " /proc/mounts; then
>> +        return 0
>> +    else
>> +        # /var/log is not available
>> +        return 1
>> +    fi
>> +}
>> +
>>  # unmount bindmounted config files
>>  #       umount_config /etc/config /etc/config2 ...
>>  #
> 
> 




More information about the ovirt-devel mailing list