A live restart of the system bus during an upgrade hung every login on a workstation until a reboot. The module owns the bus's packages, declares the bus running with no restart or reload trigger, publishes only curated events (health, services, denials; never traffic) and serves tools to look at both buses.
27 lines
748 B
Go
27 lines
748 B
Go
// The dbus module's Go bundle (novox/hq ADR 0215): the holder of node-message-bus. One process the
|
|
// node's runtime launches as the operator's account, serving the module's tools over MCP on stdio and
|
|
// running its watcher beside them, which publishes what matters about the system bus, never its
|
|
// traffic.
|
|
package main
|
|
|
|
import (
|
|
"context"
|
|
"fmt"
|
|
"os"
|
|
|
|
stdio "git.novox.be/novox/mesh-sdk/go"
|
|
)
|
|
|
|
func main() {
|
|
m := Here()
|
|
w := NewWatcher(m, func(eventType string, body any) error { return stdio.Emit(eventType, body) },
|
|
DialSystemBus, m.Denials)
|
|
ctx, cancel := context.WithCancel(context.Background())
|
|
defer cancel()
|
|
go w.Run(ctx)
|
|
if err := stdio.Serve("", Tools(m, w)); err != nil {
|
|
fmt.Fprintln(os.Stderr, err)
|
|
os.Exit(1)
|
|
}
|
|
}
|