diff --git a/libcontainerd/supervisor/remote_daemon.go b/libcontainerd/supervisor/remote_daemon.go index 252eb12397..7138dc00a8 100644 --- a/libcontainerd/supervisor/remote_daemon.go +++ b/libcontainerd/supervisor/remote_daemon.go @@ -212,9 +212,8 @@ func (r *remote) startContainerd() error { r.logger.WithError(err).Warn("failed to adjust OOM score") } - err = pidfile.Write(r.pidFile, r.daemonPid) - if err != nil { - process.Kill(r.daemonPid) + if err := pidfile.Write(r.pidFile, r.daemonPid); err != nil { + _ = process.Kill(r.daemonPid) return errors.Wrap(err, "libcontainerd: failed to save daemon pid to disk") } diff --git a/libcontainerd/supervisor/remote_daemon_linux.go b/libcontainerd/supervisor/remote_daemon_linux.go index 626f66d3c6..095aa3c930 100644 --- a/libcontainerd/supervisor/remote_daemon_linux.go +++ b/libcontainerd/supervisor/remote_daemon_linux.go @@ -49,9 +49,9 @@ func (r *remote) stopDaemon() { func (r *remote) killDaemon() { // Try to get a stack trace - syscall.Kill(r.daemonPid, syscall.SIGUSR1) + _ = syscall.Kill(r.daemonPid, syscall.SIGUSR1) <-time.After(100 * time.Millisecond) - process.Kill(r.daemonPid) + _ = process.Kill(r.daemonPid) } func (r *remote) platformCleanup() { diff --git a/libcontainerd/supervisor/remote_daemon_windows.go b/libcontainerd/supervisor/remote_daemon_windows.go index 9cb4610509..6c3d3e8aec 100644 --- a/libcontainerd/supervisor/remote_daemon_windows.go +++ b/libcontainerd/supervisor/remote_daemon_windows.go @@ -40,7 +40,7 @@ func (r *remote) stopDaemon() { } func (r *remote) killDaemon() { - process.Kill(r.daemonPid) + _ = process.Kill(r.daemonPid) } func (r *remote) platformCleanup() {