runc/patch/0008-runc-print-error-message-during-start-into-container.patch

33 lines
843 B
Diff
Raw Normal View History

2023-01-05 17:11:59 +08:00
From 8a337b8a40bf15bc25770cc5a853e962a96435c0 Mon Sep 17 00:00:00 2001
2022-10-26 16:13:47 +08:00
From: zhongjiawei <zhongjiawei1@huawei.com>
2023-01-05 17:11:59 +08:00
Date: Thu, 5 Jan 2023 16:24:53 +0800
2022-10-26 16:13:47 +08:00
Subject: [PATCH] runc: print error message during start into container log
---
2023-01-05 17:11:59 +08:00
init.go | 2 ++
2022-10-26 16:13:47 +08:00
1 file changed, 2 insertions(+)
2023-01-05 17:11:59 +08:00
diff --git a/init.go b/init.go
2022-10-26 16:13:47 +08:00
index bddc237..a0520b5 100644
2023-01-05 17:11:59 +08:00
--- a/init.go
+++ b/init.go
2022-10-26 16:13:47 +08:00
@@ -1,6 +1,7 @@
package main
import (
+ "fmt"
"os"
"runtime"
"strconv"
@@ -34,6 +35,7 @@ func init() {
factory, _ := libcontainer.New("")
if err := factory.StartInitialization(); err != nil {
+ fmt.Fprintf(os.Stderr, "libcontainer: container start initialization failed: %s", err)
// as the error is sent back to the parent there is no need to log
// or write it to stderr because the parent process will handle this
os.Exit(1)
--
2.30.0