9p: add -nodbus flag for headless/container deployments

When running on a remote server or in a container without a D-Bus
session bus, pass -nodbus to skip the adapter entirely. Pure 9P
still works.
This commit is contained in:
Levi Neely 2026-07-18 21:40:37 +02:00
parent f065429d24
commit aeb933a3c2
1 changed files with 8 additions and 2 deletions

10
main.go
View File

@ -30,6 +30,7 @@ const serviceName = "ollie"
var tcpAddr = flag.String("tcp", "", "also listen on TCP address (e.g. :564)")
var strict = flag.Bool("strict", false, "only allow tool steps; reject inline code")
var yolo = flag.Bool("yolo", false, "skip landrun sandbox for execute_code")
var nodbus = flag.Bool("nodbus", false, "disable D-Bus adapter (for headless/container use)")
// ModelCache caches the list of models from all backends.
type ModelCache struct {
@ -185,6 +186,9 @@ func daemonize(pidPath string) {
if *yolo {
args = append(args, "-yolo")
}
if *nodbus {
args = append(args, "-nodbus")
}
cmd := exec.Command(exe, args...)
cmd.SysProcAttr = &syscall.SysProcAttr{Setsid: true}
if err := cmd.Start(); err != nil {
@ -263,8 +267,10 @@ func runServer(sockPath, pidPath string) {
})
// Start D-Bus adapter (best-effort; pure 9P still works without it).
dbusAdapter = startDBus(mgr)
dbusAdapter.WatchExisting()
if !*nodbus {
dbusAdapter = startDBus(mgr)
dbusAdapter.WatchExisting()
}
// Prefetch models asynchronously at startup
go modelCache.Refresh()