libcontainerd/supervisor: explicitly ignore process kill errors

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2023-08-14 12:36:57 +02:00
parent 7b28bc51e6
commit 178125ae39
No known key found for this signature in database
GPG key ID: 76698F39D527CE8C
3 changed files with 5 additions and 6 deletions

View file

@ -209,9 +209,8 @@ func (r *remote) startContainerd() error {
r.logger.WithError(err).Warn("failed to adjust OOM score") r.logger.WithError(err).Warn("failed to adjust OOM score")
} }
err = pidfile.Write(r.pidFile, r.daemonPid) if err := pidfile.Write(r.pidFile, r.daemonPid); err != nil {
if err != nil { _ = process.Kill(r.daemonPid)
process.Kill(r.daemonPid)
return errors.Wrap(err, "libcontainerd: failed to save daemon pid to disk") return errors.Wrap(err, "libcontainerd: failed to save daemon pid to disk")
} }

View file

@ -49,9 +49,9 @@ func (r *remote) stopDaemon() {
func (r *remote) killDaemon() { func (r *remote) killDaemon() {
// Try to get a stack trace // Try to get a stack trace
syscall.Kill(r.daemonPid, syscall.SIGUSR1) _ = syscall.Kill(r.daemonPid, syscall.SIGUSR1)
<-time.After(100 * time.Millisecond) <-time.After(100 * time.Millisecond)
process.Kill(r.daemonPid) _ = process.Kill(r.daemonPid)
} }
func (r *remote) platformCleanup() { func (r *remote) platformCleanup() {

View file

@ -40,7 +40,7 @@ func (r *remote) stopDaemon() {
} }
func (r *remote) killDaemon() { func (r *remote) killDaemon() {
process.Kill(r.daemonPid) _ = process.Kill(r.daemonPid)
} }
func (r *remote) platformCleanup() { func (r *remote) platformCleanup() {