fix lxc attach stuck when disable isulad
Signed-off-by: Neil.wrz <wangrunze13@huawei.com>
This commit is contained in:
parent
a9933eee70
commit
662a77fcb8
44
0063-fix-lxc-attach-stuck-when-disable-isulad.patch
Normal file
44
0063-fix-lxc-attach-stuck-when-disable-isulad.patch
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
From 8c605f2ab25387e75f8f0114ead645de73ed4e0e Mon Sep 17 00:00:00 2001
|
||||||
|
From: "Neil.wrz" <wangrunze13@huawei.com>
|
||||||
|
Date: Mon, 17 Apr 2023 23:28:14 -0700
|
||||||
|
Subject: [PATCH] fix lxc-attach stuck when diable isulad
|
||||||
|
|
||||||
|
Signed-off-by: Neil.wrz <wangrunze13@huawei.com>
|
||||||
|
---
|
||||||
|
src/lxc/attach.c | 4 ++++
|
||||||
|
src/lxc/terminal.c | 3 +++
|
||||||
|
2 files changed, 7 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/src/lxc/attach.c b/src/lxc/attach.c
|
||||||
|
index 568dfe1..765f1ee 100644
|
||||||
|
--- a/src/lxc/attach.c
|
||||||
|
+++ b/src/lxc/attach.c
|
||||||
|
@@ -1765,7 +1765,11 @@ int lxc_attach(struct lxc_container *container, lxc_attach_exec_t exec_function,
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
if (options->attach_flags & LXC_ATTACH_TERMINAL) {
|
||||||
|
+#ifdef HAVE_ISULAD
|
||||||
|
ret = isulad_safe_mainloop(&descr, -1);
|
||||||
|
+#else
|
||||||
|
+ ret = lxc_mainloop(&descr, -1);
|
||||||
|
+#endif
|
||||||
|
if (ret < 0) {
|
||||||
|
ret_parent = -1;
|
||||||
|
to_cleanup_pid = attached_pid;
|
||||||
|
diff --git a/src/lxc/terminal.c b/src/lxc/terminal.c
|
||||||
|
index 5d83691..2d55717 100644
|
||||||
|
--- a/src/lxc/terminal.c
|
||||||
|
+++ b/src/lxc/terminal.c
|
||||||
|
@@ -1304,6 +1304,9 @@ static int lxc_terminal_peer_default(struct lxc_terminal *terminal)
|
||||||
|
DEBUG("Not have a controlling terminal");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
+#else
|
||||||
|
+ else
|
||||||
|
+ path = "/dev/tty";
|
||||||
|
#endif
|
||||||
|
|
||||||
|
terminal->peer = lxc_unpriv(open(path, O_RDWR | O_CLOEXEC));
|
||||||
|
--
|
||||||
|
2.25.1
|
||||||
|
|
||||||
9
lxc.spec
9
lxc.spec
@ -1,4 +1,4 @@
|
|||||||
%global _release 2022102414
|
%global _release 2022102415
|
||||||
|
|
||||||
Name: lxc
|
Name: lxc
|
||||||
Version: 4.0.3
|
Version: 4.0.3
|
||||||
@ -70,6 +70,7 @@ Patch0059: 0059-remove-process-inheritable-capability.patch
|
|||||||
Patch0060: 0060-check-yajl-only-when-have-isulad.patch
|
Patch0060: 0060-check-yajl-only-when-have-isulad.patch
|
||||||
Patch0061: 0061-fix-ops-hierarchies-cause-coredump.patch
|
Patch0061: 0061-fix-ops-hierarchies-cause-coredump.patch
|
||||||
Patch0062: 0062-use-ocihooks-env-after-getenv.patch
|
Patch0062: 0062-use-ocihooks-env-after-getenv.patch
|
||||||
|
Patch0063: 0063-fix-lxc-attach-stuck-when-disable-isulad.patch
|
||||||
|
|
||||||
BuildRequires: systemd-units git libtool graphviz docbook2X doxygen chrpath
|
BuildRequires: systemd-units git libtool graphviz docbook2X doxygen chrpath
|
||||||
BuildRequires: pkgconfig(libseccomp)
|
BuildRequires: pkgconfig(libseccomp)
|
||||||
@ -250,6 +251,12 @@ make check
|
|||||||
%endif
|
%endif
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Tue Apr 18 2023 wangrunze<wangrunze13@huawei.com> - 4.0.3-2022102415
|
||||||
|
- Type:bugfix
|
||||||
|
- ID:NA
|
||||||
|
- SUG:NA
|
||||||
|
- DESC: fix lxc attach stuck when disable isulad
|
||||||
|
|
||||||
* Fri Mar 31 2023 zhangxiaoyu<zhangxiaoyu58@huawei.com> - 4.0.3-2022102414
|
* Fri Mar 31 2023 zhangxiaoyu<zhangxiaoyu58@huawei.com> - 4.0.3-2022102414
|
||||||
- Type:bugfix
|
- Type:bugfix
|
||||||
- ID:NA
|
- ID:NA
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user