Merge pull request #3563 from lifupan/stable-2.3-backport-3063

[backport from main] agent: fix the issue of missing create a new session for container
This commit is contained in:
Peng Tao 2022-01-29 14:24:17 +08:00 committed by GitHub
commit 1ccc95fba1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -664,8 +664,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);
}