From: Amy Griffis Date: Thu, 8 Oct 2009 15:37:09 +0000 (+0200) Subject: LXC do not truncate container log files on restart X-Git-Tag: v0.7.2~30 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c73a0c4ac950e62d0ed08fda3e7d85a90a6059ac;p=thirdparty%2Flibvirt.git LXC do not truncate container log files on restart * src/lxc/lxc_driver.c: use O_APPEND instead of O_TRUNC when opening the log file on lxcVmStart() --- diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c index 55210e4f17..ecdd5b7797 100644 --- a/src/lxc/lxc_driver.c +++ b/src/lxc/lxc_driver.c @@ -1153,7 +1153,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'"),