提交 c73a0c4a 编写于 作者: A Amy Griffis 提交者: Daniel Veillard

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()
上级 221b457e
...@@ -1153,7 +1153,7 @@ static int lxcVmStart(virConnectPtr conn, ...@@ -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'"),
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册