open-nomad/client/driver/spawn/spawn_posix.go

21 lines
282 B
Go

// +build !windows
package spawn
import (
"os"
"syscall"
)
func (s *Spawner) Alive() bool {
if s.spawn == nil {
var err error
if s.spawn, err = os.FindProcess(s.SpawnPid); err != nil {
return false
}
}
err := s.spawn.Signal(syscall.Signal(0))
return err == nil
}