bd-154: Implement bd daemons stop and restart subcommands

This commit is contained in:
Steve Yegge
2025-10-26 18:35:23 -07:00
parent cd86d7d2ba
commit 93e170627d
8 changed files with 161 additions and 2 deletions
+18
View File
@@ -0,0 +1,18 @@
//go:build windows
package daemon
import (
"fmt"
"os/exec"
"strconv"
)
func killProcess(pid int) error {
// Use taskkill on Windows
cmd := exec.Command("taskkill", "/PID", strconv.Itoa(pid), "/F")
if err := cmd.Run(); err != nil {
return fmt.Errorf("failed to kill PID %d: %w", pid, err)
}
return nil
}