File tree 1 file changed +11
-10
lines changed
1 file changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -324,16 +324,6 @@ func (c *Container) start(process *Process) (retErr error) {
324
324
defer process .closeClonedExes ()
325
325
326
326
logsDone := parent .forwardChildLogs ()
327
- if logsDone != nil {
328
- defer func () {
329
- // Wait for log forwarder to finish. This depends on
330
- // runc init closing the _LIBCONTAINER_LOGPIPE log fd.
331
- err := <- logsDone
332
- if err != nil && retErr == nil {
333
- retErr = fmt .Errorf ("unable to forward init logs: %w" , err )
334
- }
335
- }()
336
- }
337
327
338
328
// Before starting "runc init", mark all non-stdio open files as O_CLOEXEC
339
329
// to make sure we don't leak any files into "runc init". Any files to be
@@ -348,6 +338,17 @@ func (c *Container) start(process *Process) (retErr error) {
348
338
return fmt .Errorf ("unable to start container process: %w" , err )
349
339
}
350
340
341
+ if logsDone != nil {
342
+ defer func () {
343
+ // Wait for log forwarder to finish. This depends on
344
+ // runc init closing the _LIBCONTAINER_LOGPIPE log fd.
345
+ err := <- logsDone
346
+ if err != nil && retErr == nil {
347
+ retErr = fmt .Errorf ("unable to forward init logs: %w" , err )
348
+ }
349
+ }()
350
+ }
351
+
351
352
if process .Init {
352
353
c .fifo .Close ()
353
354
if c .config .Hooks != nil {
You can’t perform that action at this time.
0 commit comments