Privileged Mode
Run services with system-level privileges when needed.When to use
Enable privileged mode to:- Bind to ports < 1024
- Run services as different users
- Apply resource limits
- Use Linux capabilities
- Create cgroups or namespaces
Start with privileges
--drop-privileges, it applies to child service processes at
spawn time (not to read-only control commands like status or logs).
The --sys flag moves state to system directories:
/var/lib/systemg/- Runtime state/var/log/systemg/- Logs/etc/systemg/- Configuration
Configuration
User and groups
Drop privileges to specific users:www-data after binding to port 80.
Resource limits
Control system resources per service:| Field | Description |
|---|---|
nofile | Max open files |
nproc | Max processes |
memlock | Locked memory |
nice | Priority (-20 to 19) |
cpu_affinity | Pin to CPU cores |
Capabilities
Retain specific capabilities after dropping root:Cgroups v2
Limit memory and CPU usage:Namespaces
Isolate services from the host:Examples
Web server on port 80
Database with resource limits
See also
- Security - Security considerations
- Configuration - Service definitions