mirror of
https://github.com/luxfi/vm.git
synced 2026-10-30 15:13:40 +00:00
- Fix dag package imports to use vm/proto/pb/dag instead of node/proto - Fix api/health test to use atomic.Atomic from github.com/luxfi/atomic - Fix components/message test to use crypto.RandomBytes - Fix chains/manager to use correct EngineType constant
30 lines
540 B
Go
30 lines
540 B
Go
// Copyright (C) 2019-2025, Lux Industries, Inc. All rights reserved.
|
|
// See the file LICENSE for licensing terms.
|
|
|
|
//go:build !linux
|
|
// +build !linux
|
|
|
|
package subprocess
|
|
|
|
import (
|
|
"context"
|
|
"os/exec"
|
|
|
|
"github.com/luxfi/log"
|
|
)
|
|
|
|
func NewCmd(path string, args ...string) *exec.Cmd {
|
|
return exec.Command(path, args...)
|
|
}
|
|
|
|
func stop(_ context.Context, log log.Logger, cmd *exec.Cmd) {
|
|
err := cmd.Process.Kill()
|
|
if err == nil {
|
|
log.Debug("subprocess was killed")
|
|
} else {
|
|
log.Error("subprocess kill failed",
|
|
"error", err,
|
|
)
|
|
}
|
|
}
|