[Ovirt-devel] [PATCH node] Bootup mounts the local log partition if it exists
Perry Myers
pmyers at redhat.com
Wed Jan 14 15:17:08 UTC 2009
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 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
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.
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 ...
> #
--
|=- Red Hat, Engineering, Emerging Technologies, Boston -=|
|=- Email: pmyers at redhat.com -=|
|=- Office: +1 412 474 3552 Mobile: +1 703 362 9622 -=|
|=- GnuPG: E65E4F3D 88F9 F1C9 C2F3 1303 01FE 817C C5D2 8B91 E65E 4F3D -=|
More information about the ovirt-devel
mailing list