[Ovirt-devel] [PATCH] Using log rotation to minimize writing to the managed node filesystem.
Perry N. Myers
pmyers at redhat.com
Fri Jun 27 18:51:40 UTC 2008
Darryl L. Pierce wrote:
> From: Darryl Pierce <dpierce at redhat.com>
>
> First draft of this. I'm still continuing to run the managed node to see what other files are
> growing over time.
Two quick comments... How much does cronie and dependencies add to the
managed node. (I would hope not much...)
And shouldn't this stuff be in the ovirt-host rpm instead of in common-post?
Perry
> Signed-off-by: Darryl L. Pierce <dpierce at redhat.com>
> ---
> ovirt-host-creator/common-pkgs.ks | 1 +
> ovirt-host-creator/common-post.ks | 24 ++++++++++++++++++++++++
> 2 files changed, 25 insertions(+), 0 deletions(-)
>
> diff --git a/ovirt-host-creator/common-pkgs.ks b/ovirt-host-creator/common-pkgs.ks
> index 8d0ba70..2d1ad6e 100644
> --- a/ovirt-host-creator/common-pkgs.ks
> +++ b/ovirt-host-creator/common-pkgs.ks
> @@ -26,6 +26,7 @@ augeas
> nc
> bind-utils
> syslinux
> +cronie
> hal
> ovirt-managed-node
> -policycoreutils
> diff --git a/ovirt-host-creator/common-post.ks b/ovirt-host-creator/common-post.ks
> index 723b838..300bc3c 100644
> --- a/ovirt-host-creator/common-post.ks
> +++ b/ovirt-host-creator/common-post.ks
> @@ -12,6 +12,30 @@ cat > /etc/sysconfig/iptables << \EOF
> COMMIT
> EOF
>
> +echo "Setting up log rotation"
> +cat > /etc/logrotate.d/ovirt << \EOF
> +/var/log/*.log {
> + rotate 0
> + missingok
> + notifempty
> + size=10k
> +}
> +EOF
> +
> +echo "Creating the hourly rotation file"
> +cat > /etc/cron.hourly/ovirt-rotatelog" << \EOF
> +#!/bin/sh
> +
> +/usr/sbin/logrotate /etc/logrotate.d/ovirt
> +
> +EXITVALUE=$?
> +if [ $EXITVALUE != 0 ]; then
> + /usr/bin/logger -t logrotate "ALERT exited abnormally with [$EXITVALUE]"
> +fi
> +exit 0
> +EOF
> +chmod +x /etc/cron.hourly/ovirt-rotatelog
> +
> echo "Writing ovirt-functions script"
> # common functions
> cat > /etc/init.d/ovirt-functions << \EOF
--
|=- 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