Complete command-line interface reference for Sentinel.
Synopsis
sentinel [OPTIONS] [COMMAND]
Global Options
| Option | Short | Environment | Description |
|---|---|---|---|
--config <FILE> | -c | SENTINEL_CONFIG | Configuration file path |
--test | -t | Test configuration and exit | |
--verbose | Enable debug logging | ||
--daemon | -d | Run as background daemon | |
--upgrade | -u | Upgrade from running instance | |
--version | -V | Print version information | |
--help | -h | Print help information |
Commands
run (default)
Run the proxy server. This is the default command when none is specified.
# These are equivalent
Options:
-c, --config <FILE>- Configuration file path
test
Validate configuration file and exit without starting the server.
Options:
-c, --config <FILE>- Configuration file to test
Exit codes:
0- Configuration is valid1- Configuration error
Output:
INFO Testing configuration file: sentinel.kdl
INFO Configuration test successful:
INFO - 2 listener(s)
INFO - 5 route(s)
INFO - 3 upstream(s)
sentinel: configuration file sentinel.kdl test is successful
Examples
Basic Usage
# Start with configuration file
# Start with environment variable
# Use embedded default configuration
Configuration Testing
# Test configuration syntax and semantics
# Test with verbose output
Daemon Mode
# Run as daemon (background process)
# Upgrade running instance (zero-downtime restart)
Debug Mode
# Enable debug logging
# Or via environment variable
RUST_LOG=debug
Version Information
Output:
sentinel 0.1.0 (release 2025.01, commit abc1234)
Version string includes:
- Semantic version (Cargo.toml)
- CalVer release tag
- Git commit hash
Configuration Resolution
Sentinel resolves configuration in this order (first found wins):
--config/-ccommand-line argumentSENTINEL_CONFIGenvironment variable- Embedded default configuration
Process Management
Signals
| Signal | Behavior |
|---|---|
SIGTERM | Graceful shutdown (drain connections) |
SIGINT | Graceful shutdown (Ctrl+C) |
SIGHUP | Reload configuration |
Graceful Shutdown
On SIGTERM/SIGINT:
- Stop accepting new connections
- Drain in-flight requests (configurable timeout)
- Close remaining connections
- Exit with code 0
# Graceful shutdown
# Force shutdown (after graceful timeout)
Configuration Reload
# Reload configuration without restart
Reload behavior:
- Parse new configuration
- Validate syntax and semantics
- If valid: atomically swap configuration
- If invalid: keep old configuration, log error
Zero-Downtime Upgrade
# Start new instance that takes over from old
Upgrade sequence:
- New process starts
- New process signals old process
- Old process transfers listening sockets
- Old process drains connections
- Old process exits
Exit Codes
| Code | Description |
|---|---|
0 | Success / clean shutdown |
1 | Configuration error |
2 | Runtime error |
See Also
- Environment Variables - Environment variable reference
- Configuration - Configuration file format