gecod

A lightweight D-Bus daemon for coordinating time-critical multi-service workflows on embedded Linux systems.

Need to coordinate a factory reset across multiple services on your embedded device? Want to make sure all subsystems properly park their actuators, flush their logs, and unmount volumes before pulling the plug? gecod (Generic Event Coordination and Orchestration) is your solution.

It's a Tokio-based D-Bus daemon that coordinates time-critical events with registration and waiting windows—ensuring that distributed services can synchronize their actions safely and predictably.

The Problem It Solves

On embedded Linux systems, complex operations often require multiple independent services to coordinate their actions within strict time windows. Consider a controlled factory reset:

  1. An update agent initiates a "factory reset" event
  2. Subsystems (telemetry, fieldbus controllers, storage managers) need time to register their participation
  3. Each participant needs to complete cleanup work (flush logs, park actuators, unmount volumes) before proceeding
  4. The system should only reset when all participants confirm they're ready—or fail gracefully if any timeout

gecod orchestrates this entire flow with precise timing guarantees.

How It Works

The daemon implements a simple but effective state machine:

  • InitialRegistrationWindow: Services register their intent to participate
  • RegistrationWindowWaitingWindow: Registration closes, participants perform their work
  • WaitingWindowCompleted: All participants finish successfully
  • WaitingWindowExpired: Timeout reached with pending work

Throughout the process, D-Bus signals keep all subscribers informed of progress, allowing for reactive coordination without polling.

Current Status

🔨 In Active Development - Core event coordination engine is complete with full D-Bus API. The daemon is functionally ready but still needs integration tests and production hardening before deployment on embedded systems.

Key Features

  • Time-Bounded Coordination: Configurable registration and waiting windows with millisecond precision
  • Predictable Resource Usage: Fixed-capacity storage and bounded memory usage for long-running deployments
  • D-Bus Integration: Clean session/system bus API via zbus
  • Asynchronous Signals: Non-blocking event notifications prevent backpressure
  • Flexible Configuration: TOML files, environment variables, or CLI flags with layered overrides
  • Embedded-Friendly: No unbounded queues or growable maps in the hot path

Tech Stack

  • Rust with tokio for async runtime
  • zbus for D-Bus integration
  • TOML for configuration
  • Target platform: Embedded Linux (resource-constrained environments)

Perfect for: Industrial embedded systems, IoT devices, update orchestration, or any scenario requiring coordinated multi-service workflows with strict timing requirements.

Skills & Technologies