bd-154: Implement bd daemons stop and restart subcommands
This commit is contained in:
15
internal/daemon/kill_unix.go
Normal file
15
internal/daemon/kill_unix.go
Normal file
@@ -0,0 +1,15 @@
|
||||
//go:build unix
|
||||
|
||||
package daemon
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"syscall"
|
||||
)
|
||||
|
||||
func killProcess(pid int) error {
|
||||
if err := syscall.Kill(pid, syscall.SIGTERM); err != nil {
|
||||
return fmt.Errorf("failed to send SIGTERM to PID %d: %w", pid, err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
Reference in New Issue
Block a user