diff --git a/core/engine.py b/core/engine.py index 62c1ede..bf3113c 100644 --- a/core/engine.py +++ b/core/engine.py @@ -176,6 +176,18 @@ def _module_runner(module_class: Type[BaseModule], bus_queue: multiprocessing.Qu state = StateManager(db_path=state_db_path) state.start() + # CaptureBus reader thread is not inherited across fork — restart it in + # this subprocess so the module's subscribe() calls reach a live reader. + for key in ("capture_bus", "_capture_bus"): + cb = config.get(key) + if cb is not None: + cb._running = False + cb._capture_thread = None + cb._sock = None + cb._subscribers = [] + cb.start() + break + module = module_class(bus=bus_proxy, state=state, config=config) # Signal handlers for graceful shutdown