[libvirt] [PATCH 5/7] lxc: append container log file

Daniel Veillard veillard at redhat.com
Thu Oct 8 16:23:10 UTC 2009


On Mon, Oct 05, 2009 at 01:52:53PM +0100, Daniel P. Berrange wrote:
> On Sun, Oct 04, 2009 at 03:29:10PM -0400, Amy Griffis wrote:
> > Do we really want to overwrite the container log file every time we
> > restart?
> > ---
> > 
> >  src/lxc/lxc_driver.c |    2 +-
> >  1 files changed, 1 insertions(+), 1 deletions(-)
> > 
> > diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c
> > index c5a49f2..73cfecd 100644
> > --- a/src/lxc/lxc_driver.c
> > +++ b/src/lxc/lxc_driver.c
> > @@ -1037,7 +1037,7 @@ static int lxcVmStart(virConnectPtr conn,
> >          goto cleanup;
> >      }
> >  
> > -    if ((logfd = open(logfile, O_WRONLY | O_TRUNC | O_CREAT,
> > +    if ((logfd = open(logfile, O_WRONLY | O_APPEND | O_CREAT,
> >               S_IRUSR|S_IWUSR)) < 0) {
> >          virReportSystemError(conn, errno,
> >                               _("failed to open '%s'"),
> > 
> 
> ACK
> 
> Truncation can be dealt with my logrotate in a much more flexible manner

  Agreed, actually we have logrotate truccation for lxc already !
Patch pushed,

   thanks !

Daniel

-- 
Daniel Veillard      | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
daniel at veillard.com  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library  http://libvirt.org/




More information about the libvir-list mailing list