Merge pull request #1750 from mlaventure/delete-exec-pidfile

containerd-shim: Delete exec pidfile on exit
This commit is contained in:
Phil Estes 2017-11-13 12:31:59 -05:00 committed by GitHub
commit 680101f919
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -7,6 +7,7 @@ import (
"encoding/json" "encoding/json"
"fmt" "fmt"
"io" "io"
"os"
"path/filepath" "path/filepath"
"sync" "sync"
"syscall" "syscall"
@ -114,6 +115,9 @@ func (e *execProcess) delete(ctx context.Context) error {
} }
e.io.Close() e.io.Close()
} }
pidfile := filepath.Join(e.path, fmt.Sprintf("%s.pid", e.id))
// silently ignore error
os.Remove(pidfile)
return nil return nil
} }