mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-11 06:03:57 +08:00
Merge pull request #562 from cloudfoundry-incubator/avoid-sigchld-hang
Register signal handlers earlier to avoid zombies
This commit is contained in:
+2
-2
@@ -134,6 +134,8 @@ func restoreContainer(context *cli.Context, spec *specs.LinuxSpec, config *confi
|
||||
if err != nil {
|
||||
return -1, err
|
||||
}
|
||||
handler := newSignalHandler(tty)
|
||||
defer handler.Close()
|
||||
if err := container.Restore(process, options); err != nil {
|
||||
tty.Close()
|
||||
return -1, err
|
||||
@@ -149,8 +151,6 @@ func restoreContainer(context *cli.Context, spec *specs.LinuxSpec, config *confi
|
||||
if detach {
|
||||
return 0, nil
|
||||
}
|
||||
handler := newSignalHandler(tty)
|
||||
defer handler.Close()
|
||||
return handler.forward(process)
|
||||
}
|
||||
|
||||
|
||||
@@ -307,6 +307,9 @@ func runProcess(container libcontainer.Container, config *specs.Process, listenF
|
||||
return -1, err
|
||||
}
|
||||
|
||||
handler := newSignalHandler(tty)
|
||||
defer handler.Close()
|
||||
|
||||
if err := container.Start(process); err != nil {
|
||||
tty.Close()
|
||||
return -1, err
|
||||
@@ -323,8 +326,6 @@ func runProcess(container libcontainer.Container, config *specs.Process, listenF
|
||||
if detach {
|
||||
return 0, nil
|
||||
}
|
||||
handler := newSignalHandler(tty)
|
||||
defer handler.Close()
|
||||
|
||||
return handler.forward(process)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user