Revert "use process group kill"

This reverts commit a869bb5166.
This commit is contained in:
Ralf Haferkamp
2026-04-28 12:22:09 +02:00
committed by Ralf Haferkamp
parent b309c39386
commit fb532206b3

View File

@@ -43,10 +43,6 @@ func Start(envMap []string) {
} else {
cmd.Env = append(os.Environ(), envMap...)
}
// Start the command in a new process group to be able to kill it and all its children
cmd.SysProcAttr = &syscall.SysProcAttr{
Setpgid: true,
}
logs, err := cmd.StderrPipe()
if err != nil {
@@ -125,12 +121,7 @@ func Stop() (bool, string) {
return true, "OpenCloud server is not running"
}
// kill the process group to stop the server and all its children
if cmd.Process != nil {
syscall.Kill(-cmd.Process.Pid, syscall.SIGTERM)
time.Sleep(10 * time.Second)
syscall.Kill(-cmd.Process.Pid, syscall.SIGKILL)
}
exec.Command("sh", "-c", "pkill -9 -f 'opencloud|nats-server' 2>/dev/null || true").Run()
cmd = nil
return true, "OpenCloud server stopped successfully"