How It Works
systemg is a single binary that manages processes as a supervisor.
Architecture
CLI → Unix Socket → Supervisor → Services
↓
State Files
When you run sysg start, the supervisor launches and monitors your services. Subsequent commands communicate with this supervisor via Unix socket.
Process lifecycle
- Start: Services launch in dependency order
- Monitor: Supervisor tracks PIDs and health
- Restart: Failed services restart per policy
- Stop: Services terminate in reverse order
State location
All runtime data lives in one place:
User mode (default):
~/.local/share/systemg/- State files~/.local/share/systemg/logs/- Service logs
System mode (sudo sysg --sys):
/var/lib/systemg/- State files/var/log/systemg/- Service logs
Daemon vs foreground
Foreground (default):
- Services run as children of your shell
Ctrl+Cstops everything- Good for development
Daemon (--daemonize):
- Supervisor runs in background
- Services survive terminal close
- Good for production
Topics
- Commands - CLI reference
- Configuration - Service definitions
- Cron - Scheduled tasks
- Webhooks - Lifecycle hooks
- State - Runtime files
- Logs - Supervisor logs
- Privileged Mode - System features