kodegen Daemon
A high-performance Unix daemon library with crossbeam-based service management.
Features
- Zero-allocation hot paths: Uses crossbeam channels and fixed-size enums
- True Unix daemon: Double-fork daemonization with systemd auto-detection
- Service management: Supervise processes with automatic restart and health monitoring
- System integration: Self-installation with systemd/launchd support
- Async compatible: Can manage async applications while using sync internals
Quick Start
As a Library
Add to your Cargo.toml:
[]
= "0.1"
Use in your application:
use ;
use Path;
As a Standalone Daemon
Build and install:
Configure services in /etc/kodegend/services/:
# /etc/kodegend/services/my-app.toml
= "my-app"
= "/usr/local/bin/my-app --serve"
= true
= "www-data"
= 5
[]
= "http"
= "http://localhost:8080/health"
= 30
Start the daemon:
Architecture
- ServiceManager: Central event loop using crossbeam channels
- ServiceWorker: Individual service supervisor threads
- IPC: Wait-free message passing with
Cmd/Evtenums - Daemon: Unix daemonization with systemd detection
- Installer: Self-installation with system integration
System Requirements
- Unix-like OS (Linux, macOS)
- systemd (Linux) or launchd (macOS) for system integration
- Root privileges for installation
License
Apache-2.0