Integrate sys.SetSubreaper, sys.GetSubreaper in sys/reaper package
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
fffea312aa
commit
1b66fecad3
@ -20,7 +20,6 @@ import (
|
||||
"os"
|
||||
"os/signal"
|
||||
|
||||
"github.com/containerd/containerd/sys"
|
||||
"github.com/containerd/containerd/sys/reaper"
|
||||
runc "github.com/containerd/go-runc"
|
||||
"github.com/containerd/ttrpc"
|
||||
@ -36,7 +35,7 @@ func setupSignals() (chan os.Signal, error) {
|
||||
// for waiting on processes
|
||||
runc.Monitor = reaper.Default
|
||||
// set the shim as the subreaper for all orphaned processes created by the container
|
||||
if err := sys.SetSubreaper(1); err != nil {
|
||||
if err := reaper.SetSubreaper(1); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return signals, nil
|
||||
|
@ -17,7 +17,7 @@
|
||||
package shim
|
||||
|
||||
import (
|
||||
"github.com/containerd/containerd/sys"
|
||||
"github.com/containerd/containerd/sys/reaper"
|
||||
"github.com/containerd/ttrpc"
|
||||
)
|
||||
|
||||
@ -26,5 +26,5 @@ func newServer() (*ttrpc.Server, error) {
|
||||
}
|
||||
|
||||
func subreaper() error {
|
||||
return sys.SetSubreaper(1)
|
||||
return reaper.SetSubreaper(1)
|
||||
}
|
||||
|
@ -14,7 +14,7 @@
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package sys
|
||||
package reaper
|
||||
|
||||
import (
|
||||
"unsafe"
|
Loading…
Reference in New Issue
Block a user