Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

runc fails if run with _LIBCONTAINER_INITPIPE env var set #4340

Open
ningmingxiao opened this issue Jul 6, 2024 · 4 comments
Open

runc fails if run with _LIBCONTAINER_INITPIPE env var set #4340

ningmingxiao opened this issue Jul 6, 2024 · 4 comments

Comments

@ningmingxiao
Copy link

ningmingxiao commented Jul 6, 2024

Description

runc can't run if use custom env

Steps to reproduce the issue

1.export _LIBCONTAINER_INITPIPE=1111a
2.root@LIN-FB738BFD367 runc]# runc list
FATAL: could not inform the parent we are past initial setup: Bad file descriptor
3.[root@LIN-FB738BFD367 runc]# ./runc -v
FATAL: could not inform the parent we are past initial setup: Bad file descriptor
[root@LIN-FB738BFD367 mycontainer]# ./runc run test001
FATAL: could not inform the parent we are past initial setup: Bad file descriptor

Describe the results you received and expected

runc can run well

What version of runc are you using?

1.1.12

Host OS information

ubuntu/centos linux

Host kernel information

any kernel

@ningmingxiao
Copy link
Author

this pr may fix #4339

@kolyshkin kolyshkin changed the title runc can't run if use custom env runc fails if run with _LIBCONTAINER_INITPIPE env var set Jul 10, 2024
@kolyshkin
Copy link
Contributor

@ningmingxiao just curious, how did you discovered this issue?

@ningmingxiao
Copy link
Author

ningmingxiao commented Jul 10, 2024

@ningmingxiao just curious, how did you discovered this issue?

I study runc code to solve our problem, find runc call nsexec every time. I find runc use some custom env like _LIBCONTAINER_INITPIPE.
I want runc doesn't call nsexec every time. but can't find some good way.

@kolyshkin
Copy link
Contributor

From what I see, this is not a real issue, but rather an observation that comes from reading the source code.

I want runc doesn't call nsexec every time. but can't find some good way.

You can build your own runtime using libcontainer stuff, and have a separate init binary, too.

As pointed out by @cyphar in #4343, we want to keep runc as a single binary. Also, nsexec should be executed before Go runtime. With these requirements, it's impossible to not run nsexec.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants