@@ -14,6 +14,7 @@ import (
1414 "github.com/containerd/containerd"
1515 "github.com/containerd/containerd/services/server/config"
1616 "github.com/containerd/containerd/sys"
17+ "github.com/docker/docker/pkg/process"
1718 "github.com/docker/docker/pkg/system"
1819 "github.com/pelletier/go-toml"
1920 "github.com/pkg/errors"
@@ -145,7 +146,7 @@ func (r *remote) getContainerdPid() (int, error) {
145146 if err != nil {
146147 return - 1 , err
147148 }
148- if system . IsProcessAlive (int (pid )) {
149+ if process . Alive (int (pid )) {
149150 return int (pid ), nil
150151 }
151152 }
@@ -238,7 +239,7 @@ func (r *remote) startContainerd() error {
238239
239240 err = os .WriteFile (r .pidFile , []byte (strconv .Itoa (r .daemonPid )), 0660 )
240241 if err != nil {
241- system . KillProcess (r .daemonPid )
242+ process . Kill (r .daemonPid )
242243 return errors .Wrap (err , "libcontainerd: failed to save daemon pid to disk" )
243244 }
244245
@@ -357,15 +358,15 @@ func (r *remote) monitorDaemon(ctx context.Context) {
357358 r .logger .WithError (err ).WithField ("binary" , binaryName ).Debug ("daemon is not responding" )
358359
359360 transientFailureCount ++
360- if transientFailureCount < maxConnectionRetryCount || system . IsProcessAlive (r .daemonPid ) {
361+ if transientFailureCount < maxConnectionRetryCount || process . Alive (r .daemonPid ) {
361362 delay = time .Duration (transientFailureCount ) * 200 * time .Millisecond
362363 continue
363364 }
364365 client .Close ()
365366 client = nil
366367 }
367368
368- if system . IsProcessAlive (r .daemonPid ) {
369+ if process . Alive (r .daemonPid ) {
369370 r .logger .WithField ("pid" , r .daemonPid ).Info ("killing and restarting containerd" )
370371 r .killDaemon ()
371372 }
0 commit comments