Service Management¶
Trident ships with service integration for both systemd (Linux) and rc.d (FreeBSD).
systemd (Linux)¶
The systemd unit file is installed automatically by the package or by using --with-service with the install script.
Start Trident¶
Stop Trident¶
Enable on Boot¶
Or start and enable in one command:
Check Status¶
View Logs¶
Filter by time:
Reload Configuration¶
Trident supports graceful configuration reload via SIGHUP:
Unit File Details¶
The default unit file (/lib/systemd/system/trident.service):
[Unit]
Description=Trident HTTP Cache Proxy
Documentation=https://github.com/qoliber/trident
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
User=trident
Group=trident
EnvironmentFile=-/etc/default/trident
ExecStart=/usr/bin/trident --config ${TRIDENT_CONFIG}
ExecReload=/bin/kill -HUP $MAINPID
Restart=on-failure
RestartSec=5s
# Security hardening
AmbientCapabilities=CAP_NET_BIND_SERVICE
NoNewPrivileges=true
ProtectSystem=strict
ProtectHome=true
ReadWritePaths=/var/lib/trident /var/log/trident
PrivateTmp=true
PrivateDevices=true
ProtectKernelTunables=true
ProtectKernelModules=true
ProtectControlGroups=true
# Resource limits
LimitNOFILE=65535
LimitNPROC=4096
[Install]
WantedBy=multi-user.target
Key properties:
- Runs as
tridentuser — never as root CAP_NET_BIND_SERVICE— allows binding to ports below 1024- Security hardening — filesystem, kernel, and device protections enabled
- Auto-restart — restarts on failure after 5 seconds
- 65535 file descriptors — sufficient for high-concurrency workloads
Environment File¶
The config path is set via /etc/default/trident:
Edit this file to change the configuration file path or add environment variables.
rc.d (FreeBSD)¶
Enable Trident¶
Add to /etc/rc.conf:
Start Trident¶
Stop Trident¶
Reload Configuration¶
rc.conf Variables¶
| Variable | Default | Description |
|---|---|---|
trident_enable |
NO |
Enable the service |
trident_config |
/usr/local/etc/trident/config.toml |
Config file path |
trident_user |
trident |
Run-as user |
trident_group |
trident |
Run-as group |
trident_flags |
(empty) | Additional CLI flags |
trident_pidfile |
/var/run/trident.pid |
PID file path |
Example customization: