Replace execdrivers with containerd implementation
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com> Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com> Signed-off-by: Anusha Ragunathan <anusha@docker.com> Upstream-commit: 9c4570a958df42d1ad19364b1a8da55b891d850a Component: engine
This commit is contained in:
22
components/engine/utils/process_unix.go
Normal file
22
components/engine/utils/process_unix.go
Normal file
@ -0,0 +1,22 @@
|
||||
// +build linux freebsd
|
||||
|
||||
package utils
|
||||
|
||||
import (
|
||||
"syscall"
|
||||
)
|
||||
|
||||
// IsProcessAlive returns true if process with a given pid is running.
|
||||
func IsProcessAlive(pid int) bool {
|
||||
err := syscall.Kill(pid, syscall.Signal(0))
|
||||
if err == nil || err == syscall.EPERM {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// KillProcess force-stops a process.
|
||||
func KillProcess(pid int) {
|
||||
syscall.Kill(pid, syscall.SIGKILL)
|
||||
}
|
||||
20
components/engine/utils/process_windows.go
Normal file
20
components/engine/utils/process_windows.go
Normal file
@ -0,0 +1,20 @@
|
||||
package utils
|
||||
|
||||
// IsProcessAlive returns true if process with a given pid is running.
|
||||
func IsProcessAlive(pid int) bool {
|
||||
// TODO Windows containerd. Not sure this is needed
|
||||
// p, err := os.FindProcess(pid)
|
||||
// if err == nil {
|
||||
// return true
|
||||
// }
|
||||
return false
|
||||
}
|
||||
|
||||
// KillProcess force-stops a process.
|
||||
func KillProcess(pid int) {
|
||||
// TODO Windows containerd. Not sure this is needed
|
||||
// p, err := os.FindProcess(pid)
|
||||
// if err == nil {
|
||||
// p.Kill()
|
||||
// }
|
||||
}
|
||||
Reference in New Issue
Block a user