github.com/ava-labs/avalanchego@v1.11.11/vms/rpcchainvm/runtime/subprocess/non_linux_stopper.go (about) 1 // Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. 2 // See the file LICENSE for licensing terms. 3 4 //go:build !linux 5 // +build !linux 6 7 package subprocess 8 9 import ( 10 "context" 11 "os/exec" 12 13 "go.uber.org/zap" 14 15 "github.com/ava-labs/avalanchego/utils/logging" 16 ) 17 18 func NewCmd(path string, args ...string) *exec.Cmd { 19 return exec.Command(path, args...) 20 } 21 22 func stop(_ context.Context, log logging.Logger, cmd *exec.Cmd) { 23 err := cmd.Process.Kill() 24 if err == nil { 25 log.Debug("subprocess was killed") 26 } else { 27 log.Error("subprocess was killed", 28 zap.Error(err), 29 ) 30 } 31 }