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/http/httputil"
|
||||||
"net/url"
|
"net/url"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
|
"runtime"
|
||||||
"sync"
|
"sync"
|
||||||
|
"syscall"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -100,6 +102,13 @@ func (i *Instance) Start() error {
|
|||||||
i.ctx, i.cancel = context.WithCancel(context.Background())
|
i.ctx, i.cancel = context.WithCancel(context.Background())
|
||||||
i.cmd = exec.CommandContext(i.ctx, "llama-server", args...)
|
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
|
var err error
|
||||||
i.stdout, err = i.cmd.StdoutPipe()
|
i.stdout, err = i.cmd.StdoutPipe()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user