mirror of
https://github.com/lordmathis/llamactl.git
synced 2025-11-06 09:04:27 +00:00
Implement platform-specific process attribute settings for llama server
This commit is contained in:
@@ -41,10 +41,7 @@ func (i *Instance) Start() error {
|
||||
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
|
||||
setProcAttrs(i.cmd)
|
||||
}
|
||||
|
||||
var err error
|
||||
|
||||
15
pkg/process_group_unix.go
Normal file
15
pkg/process_group_unix.go
Normal file
@@ -0,0 +1,15 @@
|
||||
//go:build !windows
|
||||
|
||||
package llamactl
|
||||
|
||||
import (
|
||||
"os/exec"
|
||||
"syscall"
|
||||
)
|
||||
|
||||
func setProcAttrs(cmd *exec.Cmd) {
|
||||
if cmd.SysProcAttr == nil {
|
||||
cmd.SysProcAttr = &syscall.SysProcAttr{}
|
||||
}
|
||||
cmd.SysProcAttr.Setpgid = true
|
||||
}
|
||||
9
pkg/process_group_windows.go
Normal file
9
pkg/process_group_windows.go
Normal file
@@ -0,0 +1,9 @@
|
||||
//go:build windows
|
||||
|
||||
package llamactl
|
||||
|
||||
import "os/exec"
|
||||
|
||||
func setProcAttrs(cmd *exec.Cmd) {
|
||||
// No-op on Windows
|
||||
}
|
||||
Reference in New Issue
Block a user