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()
This commit is contained in:
Amy Griffis 2009-10-08 17:37:09 +02:00 committed by Daniel Veillard
parent 221b457e69
commit c73a0c4ac9

View File

@ -1153,7 +1153,7 @@ static int lxcVmStart(virConnectPtr conn,
goto cleanup; 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) { S_IRUSR|S_IWUSR)) < 0) {
virReportSystemError(conn, errno, virReportSystemError(conn, errno,
_("failed to open '%s'"), _("failed to open '%s'"),