2019-09-18 13:51:57 -04:00
|
|
|
// +build !openbsd
|
|
|
|
|
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
2019-09-19 11:55:52 -04:00
|
|
|
"fmt"
|
|
|
|
|
2019-09-18 13:51:57 -04:00
|
|
|
"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")
|
|
|
|
}
|
2019-09-18 13:51:57 -04:00
|
|
|
bg, _ := myProc.Background()
|
|
|
|
|
|
|
|
return bg, nil
|
|
|
|
}
|