Skip to content

Commit 3af8e51

Browse files
authored
Merge pull request hyperhq#430 from pmorjan/remove-sigchild-hdl
remove global SIGCHILD handler to avoid conflicts
2 parents 117bd3b + 26b8e63 commit 3af8e51

1 file changed

Lines changed: 5 additions & 17 deletions

File tree

containerd/containerd.go

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import (
1212

1313
"github.com/codegangsta/cli"
1414
"github.com/docker/containerd/api/grpc/types"
15-
"github.com/docker/containerd/osutils"
1615
"github.com/golang/glog"
1716
"github.com/hyperhq/runv/containerd/api/grpc/server"
1817
"github.com/hyperhq/runv/driverloader"
@@ -137,28 +136,17 @@ var ContainerdCommand = cli.Command{
137136
}
138137

139138
func daemon(sv *supervisor.Supervisor, address string) error {
140-
// setup a standard reaper so that we don't leave any zombies if we are still alive
141-
// this is just good practice because we are spawning new processes
142139
s := make(chan os.Signal, 2048)
143-
signal.Notify(s, syscall.SIGCHLD, syscall.SIGTERM, syscall.SIGINT, syscall.SIGQUIT)
140+
signal.Notify(s, syscall.SIGTERM, syscall.SIGINT, syscall.SIGQUIT)
144141

145142
server, err := startServer(address, sv)
146143
if err != nil {
147144
return err
148145
}
149-
for ss := range s {
150-
switch ss {
151-
case syscall.SIGCHLD:
152-
if _, err := osutils.Reap(); err != nil {
153-
glog.Infof("containerd: reap child processes")
154-
}
155-
default:
156-
glog.Infof("stopping containerd after receiving %s", ss)
157-
time.Sleep(3 * time.Second) // TODO: fix it by proper way
158-
server.Stop()
159-
return nil
160-
}
161-
}
146+
sig := <-s
147+
glog.Infof("stopping containerd after receiving %s", sig)
148+
time.Sleep(3 * time.Second) // TODO: fix it by proper way
149+
server.Stop()
162150
return nil
163151
}
164152

0 commit comments

Comments
 (0)