plan9 doesn't support syscall.Kill

This commit is contained in:
Rudi 2022-10-22 23:22:50 -04:00
parent 3e39875b78
commit e2224092f5
Signed by: rudi
GPG Key ID: EF64F3CBD1A1EBDD
1 changed files with 6 additions and 2 deletions

View File

@ -8,7 +8,6 @@ import (
"os"
"os/exec"
"strings"
"syscall"
"time"
)
@ -137,7 +136,12 @@ func processCommand(cmd string) error {
if verb == "restart" || verb == "stop" {
for testSvc := range services {
if svc == testSvc {
err := syscall.Kill(services[svc].ProcessHandle.Pid, 9)
f, err := os.OpenFile(fmt.Sprintf("/proc/%d/ctl", services[svc].ProcessHandle.Pid), os.O_WRONLY, 0600)
if err != nil {
log.Printf("")
}
defer f.Close()
_, err = f.WriteString("kill")
if err != nil {
log.Printf(DAEMON_CTL_FAILED, err, time.Since(start))
} else {