mirror of
https://github.com/Ed1s0nZ/CyberStrikeAI.git
synced 2026-09-20 08:32:20 +02:00
feat: manage task process lifetimes and preserve turn history
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
//go:build !linux && !windows
|
||||
|
||||
package processguard
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
func configurePlatform(o *Options) error {
|
||||
if o.Mode == "required" || o.CgroupRoot != "" {
|
||||
return fmt.Errorf("kernel task containment is unavailable on this OS; use a Linux cgroup deployment")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func newPlatformGroup(id string, o Options) (Group, error) {
|
||||
if err := configurePlatform(&o); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return newUnixGroup()
|
||||
}
|
||||
func guardianMain(dec *json.Decoder, enc *json.Encoder) error {
|
||||
var req watchRequest
|
||||
if err := dec.Decode(&req); err != nil {
|
||||
return err
|
||||
}
|
||||
if req.Name != "process_group" {
|
||||
return fmt.Errorf("unsupported guardian")
|
||||
}
|
||||
return groupGuardian(dec, enc)
|
||||
}
|
||||
Reference in New Issue
Block a user