Move reaper under shim package
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
parent
cff5e75df8
commit
0bafe236b4
@ -39,7 +39,6 @@ import (
|
||||
"github.com/containerd/containerd/linux/shim"
|
||||
shimapi "github.com/containerd/containerd/linux/shim/v1"
|
||||
"github.com/containerd/containerd/namespaces"
|
||||
"github.com/containerd/containerd/reaper"
|
||||
"github.com/containerd/typeurl"
|
||||
ptypes "github.com/gogo/protobuf/types"
|
||||
"github.com/pkg/errors"
|
||||
@ -194,7 +193,7 @@ func handleSignals(logger *logrus.Entry, signals chan os.Signal, server *ttrpc.S
|
||||
case s := <-signals:
|
||||
switch s {
|
||||
case unix.SIGCHLD:
|
||||
if err := reaper.Reap(); err != nil {
|
||||
if err := shim.Reap(); err != nil {
|
||||
logger.WithError(err).Error("reap exit status")
|
||||
}
|
||||
case unix.SIGTERM, unix.SIGINT:
|
||||
@ -248,11 +247,11 @@ func (l *remoteEventsPublisher) Publish(ctx context.Context, topic string, event
|
||||
}
|
||||
cmd := exec.CommandContext(ctx, containerdBinaryFlag, "--address", l.address, "publish", "--topic", topic, "--namespace", ns)
|
||||
cmd.Stdin = bytes.NewReader(data)
|
||||
c, err := reaper.Default.Start(cmd)
|
||||
c, err := shim.Default.Start(cmd)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
status, err := reaper.Default.Wait(cmd, c)
|
||||
status, err := shim.Default.Wait(cmd, c)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -22,7 +22,7 @@ import (
|
||||
"os"
|
||||
"os/signal"
|
||||
|
||||
"github.com/containerd/containerd/reaper"
|
||||
"github.com/containerd/containerd/linux/shim"
|
||||
runc "github.com/containerd/go-runc"
|
||||
"github.com/stevvooe/ttrpc"
|
||||
)
|
||||
@ -34,7 +34,7 @@ func setupSignals() (chan os.Signal, error) {
|
||||
signal.Notify(signals)
|
||||
// make sure runc is setup to use the monitor
|
||||
// for waiting on processes
|
||||
runc.Monitor = reaper.Default
|
||||
runc.Monitor = shim.Default
|
||||
return signals, nil
|
||||
}
|
||||
|
||||
|
@ -20,7 +20,7 @@ import (
|
||||
"os"
|
||||
"os/signal"
|
||||
|
||||
"github.com/containerd/containerd/reaper"
|
||||
"github.com/containerd/containerd/linux/shim"
|
||||
runc "github.com/containerd/go-runc"
|
||||
"github.com/opencontainers/runc/libcontainer/system"
|
||||
"github.com/stevvooe/ttrpc"
|
||||
@ -34,7 +34,7 @@ func setupSignals() (chan os.Signal, error) {
|
||||
signal.Notify(signals, unix.SIGTERM, unix.SIGINT, unix.SIGCHLD, unix.SIGPIPE)
|
||||
// make sure runc is setup to use the monitor
|
||||
// for waiting on processes
|
||||
runc.Monitor = reaper.Default
|
||||
runc.Monitor = shim.Default
|
||||
// set the shim as the subreaper for all orphaned processes created by the container
|
||||
if err := system.SetSubreaper(1); err != nil {
|
||||
return nil, err
|
||||
|
@ -22,7 +22,7 @@ import (
|
||||
"os"
|
||||
"os/signal"
|
||||
|
||||
"github.com/containerd/containerd/reaper"
|
||||
"github.com/containerd/containerd/linux/shim"
|
||||
runc "github.com/containerd/go-runc"
|
||||
"github.com/stevvooe/ttrpc"
|
||||
)
|
||||
@ -34,7 +34,7 @@ func setupSignals() (chan os.Signal, error) {
|
||||
signal.Notify(signals)
|
||||
// make sure runc is setup to use the monitor
|
||||
// for waiting on processes
|
||||
runc.Monitor = reaper.Default
|
||||
runc.Monitor = shim.Default
|
||||
return signals, nil
|
||||
}
|
||||
|
||||
|
@ -16,7 +16,7 @@
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package reaper
|
||||
package shim
|
||||
|
||||
import (
|
||||
"os/exec"
|
@ -34,7 +34,6 @@ import (
|
||||
shimapi "github.com/containerd/containerd/linux/shim/v1"
|
||||
"github.com/containerd/containerd/log"
|
||||
"github.com/containerd/containerd/namespaces"
|
||||
"github.com/containerd/containerd/reaper"
|
||||
"github.com/containerd/containerd/runtime"
|
||||
runc "github.com/containerd/go-runc"
|
||||
"github.com/containerd/typeurl"
|
||||
@ -81,7 +80,7 @@ func NewService(config Config, publisher events.Publisher) (*Service, error) {
|
||||
context: ctx,
|
||||
processes: make(map[string]proc.Process),
|
||||
events: make(chan interface{}, 128),
|
||||
ec: reaper.Default.Subscribe(),
|
||||
ec: Default.Subscribe(),
|
||||
}
|
||||
go s.processExits()
|
||||
if err := s.initPlatform(); err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user