packer-cn/background_check.go

20 lines
334 B
Go
Raw Normal View History

// +build !openbsd
package main
import (
2019-09-19 11:55:52 -04:00
"fmt"
"github.com/shirou/gopsutil/process"
)
func checkProcess(currentPID int) (bool, error) {
2019-09-19 11:55:52 -04:00
myProc, err := process.NewProcess(int32(currentPID))
if err != nil {
return false, fmt.Errorf("Error figuring out Packer process info")
}
bg, _ := myProc.Background()
return bg, nil
}