Proposal: bindmount init's procfs
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 20/100
- Issue type
- Feature
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- go
- Domain
- operating-systems
Research direction
Start by tracing runc's handling of the initProcessTime check and the /run/runc/[ctr]/init path, then investigate how bind-mounted /proc/[pid] entries behave across PID namespaces. The issue does not name implementation files or tests; done would require choosing and validating a concrete approach for managing containers and detecting the init process without the existing magic.
Written by the indexing model from the issue text.
Description
So, I was playing around with different tricks you can do with persistent namespaces and I noticed that you can bindmount /proc/[pid] directories:
% mount --bind /proc/1 /tmp/init
% cat /tmp/init/stat
1 (systemd) S 0 1 1 0 -1 4210944 91669 332185088 31 11021 346 382 571372 98303 20 0 1 0 2 127012864 1248 18446744073709551615 1 1 0 0 0 0 671173123 4096 1260 0 0 0 17 0 0 0 581 0 0 0 0 0 0 0 0 0 0
% mount --bind /proc/self /tmp/self
% ls /tmp/self
ls: cannot open directory '/tmp/self': No such process
This means there are two things that we can solve with this:
-
We can manage containers from a different PID namespace, because the
/proc/self/statpseudo-file will generate the correct PID for us. I'm not sure what happens if you try to access it from a different namespace though (probablyESRCH). -
We can remove the
initProcessTimemagic with a simple check to see if/run/runc/[ctr]/initgives usESRCH. This is a fool-proof method because we're pinning the kernelstruct task'sprocfsentry.
There's also some other cool stuff we could do.
- Dominant language
- Go
- Stars
- 13.5k
- Forks
- 2.3k
- Avg merge
- 2d 8h
- Merged PRs (30d)
- 30
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from opencontainers/runc
-
`root.readonly` is silently ignored (rootfs left writable) when the container has no mount namespace Openllm-generated
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
opencontainers/runc#5371 ·
-
llm-generated
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
opencontainers/runc#5370 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
opencontainers/runc#2214 · 3 comments ·
-
Difficulty 1/5 Under an hour Newbie friendliness 68/100
opencontainers/runc#1679 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
opencontainers/runc#5474 ·
All issues in opencontainers/runc
Similar issues
-
optimization optimization:agents-md-curator
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
githubnext/gh-aw-cao#13143 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
blinklabs-io/bursa#904 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
yanet-platform/ipfw-go#129 ·
-
bug confmap/provider/googlesecretmanagerprovider needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
open-telemetry/opentelemetry-collector-contrib#51273 · 2 comments ·
-
bug: AI Gateway client filter lists "Unknown" twice when NULL and literal Unknown clients coexist Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 90/100