diff --git a/main.go b/main.go index 4e6fb1e..34b6399 100644 --- a/main.go +++ b/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 {