plan9 doesn't support syscall.Kill
This commit is contained in:
parent
3e39875b78
commit
e2224092f5
8
main.go
8
main.go
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user