mirror of
https://git.sdf.org/rudi/headless9.git
synced 2026-03-22 05:17:27 +00:00
plan9 doesn't support syscall.Kill
This commit is contained in:
8
main.go
8
main.go
@ -8,7 +8,6 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"strings"
|
"strings"
|
||||||
"syscall"
|
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -137,7 +136,12 @@ func processCommand(cmd string) error {
|
|||||||
if verb == "restart" || verb == "stop" {
|
if verb == "restart" || verb == "stop" {
|
||||||
for testSvc := range services {
|
for testSvc := range services {
|
||||||
if svc == testSvc {
|
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 {
|
if err != nil {
|
||||||
log.Printf(DAEMON_CTL_FAILED, err, time.Since(start))
|
log.Printf(DAEMON_CTL_FAILED, err, time.Since(start))
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user