MCPcopy
hub / github.com/opencontainers/runc / containerInit

Function containerInit

libcontainer/init_linux.go:241–269  ·  view source on GitHub ↗
(t initType, config *initConfig, pipe *syncSocket, consoleSocket, pidfdSocket, fifoFile, logPipe *os.File)

Source from the content-addressed store, hash-verified

239}
240
241func containerInit(t initType, config *initConfig, pipe *syncSocket, consoleSocket, pidfdSocket, fifoFile, logPipe *os.File) error {
242 // Clean the RLIMIT_NOFILE cache in go runtime.
243 // Issue: https://github.com/opencontainers/runc/issues/4195
244 maybeClearRlimitNofileCache(config.Rlimits)
245
246 switch t {
247 case initSetns:
248 i := &linuxSetnsInit{
249 pipe: pipe,
250 consoleSocket: consoleSocket,
251 pidfdSocket: pidfdSocket,
252 config: config,
253 logPipe: logPipe,
254 }
255 return i.Init()
256 case initStandard:
257 i := &linuxStandardInit{
258 pipe: pipe,
259 consoleSocket: consoleSocket,
260 pidfdSocket: pidfdSocket,
261 parentPid: unix.Getppid(),
262 config: config,
263 fifoFile: fifoFile,
264 logPipe: logPipe,
265 }
266 return i.Init()
267 }
268 return fmt.Errorf("unknown init type %q", t)
269}
270
271// verifyCwd ensures that the current directory is actually inside the mount
272// namespace root of the current process.

Callers 1

startInitializationFunction · 0.85

Calls 2

InitMethod · 0.95

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…