From c73a0c4ac950e62d0ed08fda3e7d85a90a6059ac Mon Sep 17 00:00:00 2001 From: Amy Griffis Date: Thu, 8 Oct 2009 17:37:09 +0200 Subject: [PATCH] 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() --- src/lxc/lxc_driver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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'"),