diff --git a/0063-fix-lxc-attach-stuck-when-disable-isulad.patch b/0063-fix-lxc-attach-stuck-when-disable-isulad.patch new file mode 100644 index 0000000000000000000000000000000000000000..8dd99f0d0079eb885a7c41dfcb6e3248c0aecef0 --- /dev/null +++ b/0063-fix-lxc-attach-stuck-when-disable-isulad.patch @@ -0,0 +1,44 @@ +From 8c605f2ab25387e75f8f0114ead645de73ed4e0e Mon Sep 17 00:00:00 2001 +From: "Neil.wrz" +Date: Mon, 17 Apr 2023 23:28:14 -0700 +Subject: [PATCH] fix lxc-attach stuck when diable isulad + +Signed-off-by: Neil.wrz +--- + 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 + diff --git a/lxc.spec b/lxc.spec index c3bee5afb8236213e3e08e8165626a2397905ebd..3b22a64800518f9024ca839433bb1645efcb26c5 100644 --- a/lxc.spec +++ b/lxc.spec @@ -1,4 +1,4 @@ -%global _release 2022102414 +%global _release 2022102415 Name: lxc Version: 4.0.3 @@ -70,6 +70,7 @@ Patch0059: 0059-remove-process-inheritable-capability.patch Patch0060: 0060-check-yajl-only-when-have-isulad.patch Patch0061: 0061-fix-ops-hierarchies-cause-coredump.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: pkgconfig(libseccomp) @@ -250,6 +251,12 @@ make check %endif %changelog +* Tue Apr 18 2023 wangrunze - 4.0.3-2022102415 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC: fix lxc attach stuck when disable isulad + * Fri Mar 31 2023 zhangxiaoyu - 4.0.3-2022102414 - Type:bugfix - ID:NA