Overview
Daemon control commands interact with a running TurkeyDPI daemon (started withrun command) via Unix socket. These commands allow you to monitor status, gather statistics, and manage the engine without restarting.
All commands communicate through the control socket (default: /tmp/turkeydpi.sock).
Commands
start
Start the DPI bypass engine.stop command or initialization.
Note: The engine auto-starts when daemon launches, so this is mainly used after explicit stop.
stop
Stop the DPI bypass engine.- Stops accepting new flows
- Existing flows are completed
- Control server remains active
- Proxy backend (if enabled) stops accepting connections
status
Display detailed daemon status.Engine state:
Stopped, Starting, Running, Stopping, or ErrorWhether engine is currently processing packets
Number of currently tracked flows in the flow table
Total packets processed since engine start
Total data processed (formatted: B, KB, MB, GB)
Total error count since engine start
Most recent error message (if any)
Path to loaded configuration file (if specified)
health
Display health information and system details.TurkeyDPI version (from Cargo.toml)
Control protocol API version (currently
1.0.0)Overall daemon running status
Seconds since daemon started
Active backend type:
proxy, transparent, or tunOperating system and architecture
stats
Display detailed packet processing statistics.Total packets received from clients
Total packets sent to destinations
Total data received (formatted)
Total data sent (formatted)
Packets dropped due to errors or policy
Packets matching configured rules
Packets successfully transformed
Transformation failures
Currently tracked flows
Total flows created since start
Flows removed (timeout or table full)
Total packet fragments generated
Cumulative jitter delay applied (milliseconds)
Decoy packets sent (if decoy transform enabled)
reset-stats
Reset all statistics counters to zero.stats command to 0. Does not affect:
- Flow table (active flows remain)
- Engine state
- Configuration
Global Options
All daemon control commands support these global options:Path to control socket.Must match the socket path used when starting the daemon with
run --socket.Example:Logging level for the command itself (not the daemon).
Output logs in JSON format.
Examples
Monitor active connections
Check health in script
Get uptime
Check transformation effectiveness
Monitor with custom socket
Integration Examples
Prometheus Exporter Script
Health Check for Monitoring
Auto-restart on Error State
Control Protocol
The control commands use a Unix socket protocol with JSON messages:Request Format
Response Format
health- Get health infostart- Start enginestop- Stop engineget_config- Get current configset_config- Update configreload- Reload from fileget_stats- Get statisticsreset_stats- Reset countersget_status- Get statusping- Connectivity test
Troubleshooting
Failed to connect to socket
Failed to connect to socket
Causes:
- Daemon not running
- Wrong socket path
- Permission denied
Connection refused
Connection refused
Daemon is running but not accepting connections. Check logs:
Stale socket file
Stale socket file
Socket file exists but daemon is not running:
Command timeout
Command timeout
Daemon is overloaded or hung. Check resource usage:
See Also
- run command - Start the daemon
- Configuration Management - Config validation and generation
- Configuration Guide - Full configuration reference