mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-04-28 19:54:35 +00:00
agent: fix the issue of missing create a new session for container
When the container didn't had a tty console, it would be in a same process group with the kata-agent, which wasn't expected. Thus, create a new session for the container process. Fixes: #3063 Signed-off-by: Fupan Li <fupan.lfp@antgroup.com>
This commit is contained in:
parent
076dbe6cea
commit
bbaf57adb0
@ -663,8 +663,8 @@ fn do_init_child(cwfd: RawFd) -> Result<()> {
|
||||
let _ = unistd::close(crfd);
|
||||
let _ = unistd::close(cwfd);
|
||||
|
||||
unistd::setsid().context("create a new session")?;
|
||||
if oci_process.terminal {
|
||||
unistd::setsid()?;
|
||||
unsafe {
|
||||
libc::ioctl(0, libc::TIOCSCTTY);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user