[CRIU] [PATCH 5/5] criu: call kerndat_init() after log_init()

Andrei Vagin avagin at virtuozzo.com
Thu Sep 13 02:41:15 MSK 2018


We don't have rights to print anything into standard descriptors
and we want to have all output in a specified log file.

Signed-off-by: Andrei Vagin <avagin at virtuozzo.com>
---
 criu/cr-service.c | 3 +++
 criu/crtools.c    | 6 +++---
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/criu/cr-service.c b/criu/cr-service.c
index 8b06f3bb8..dbeb1a881 100644
--- a/criu/cr-service.c
+++ b/criu/cr-service.c
@@ -371,6 +371,9 @@ static int setup_opts_from_req(int sk, CriuOpts *req)
 		goto err;
 	}
 
+	if (kerndat_init())
+		return 1;
+
 	if (log_keep_err()) {
 		pr_perror("Can't tune log");
 		goto err;
diff --git a/criu/crtools.c b/criu/crtools.c
index 8e98d1599..64d298de7 100644
--- a/criu/crtools.c
+++ b/criu/crtools.c
@@ -58,9 +58,6 @@ static int early_init(void)
 	if (init_service_fd())
 		return 1;
 
-	if (kerndat_init())
-		return 1;
-
 	return 0;
 }
 
@@ -214,6 +211,9 @@ int main(int argc, char *argv[], char *envp[])
 	if (log_init(opts.output))
 		return 1;
 
+	if (kerndat_init())
+		return 1;
+
 	if (opts.deprecated_ok)
 		pr_debug("DEPRECATED ON\n");
 
-- 
2.14.3



More information about the CRIU mailing list