mirror of
https://github.com/lordmathis/llamactl.git
synced 2025-11-05 16:44:22 +00:00
Set process group ID for non-Windows systems during instance start
This commit is contained in:
@@ -10,7 +10,9 @@ import (
|
||||
"net/http/httputil"
|
||||
"net/url"
|
||||
"os/exec"
|
||||
"runtime"
|
||||
"sync"
|
||||
"syscall"
|
||||
"time"
|
||||
)
|
||||
|
||||
@@ -100,6 +102,13 @@ func (i *Instance) Start() error {
|
||||
i.ctx, i.cancel = context.WithCancel(context.Background())
|
||||
i.cmd = exec.CommandContext(i.ctx, "llama-server", args...)
|
||||
|
||||
if runtime.GOOS != "windows" {
|
||||
if i.cmd.SysProcAttr == nil {
|
||||
i.cmd.SysProcAttr = &syscall.SysProcAttr{}
|
||||
}
|
||||
i.cmd.SysProcAttr.Setpgid = true
|
||||
}
|
||||
|
||||
var err error
|
||||
i.stdout, err = i.cmd.StdoutPipe()
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user