- Remove invalid --config flag from exporter service template - Change ReadOnlyPaths to ReadWritePaths for catalog access - Add copyBinary() to install binary to /usr/local/bin (ProtectHome compat) - Fix exporter status detection using direct systemctl check - Add os/exec import for status check
38 lines
781 B
Desktop File
38 lines
781 B
Desktop File
[Unit]
|
|
Description=DBBackup Prometheus Metrics Exporter
|
|
Documentation=https://github.com/PlusOne/dbbackup
|
|
After=network-online.target
|
|
|
|
[Service]
|
|
Type=simple
|
|
User={{.User}}
|
|
Group={{.Group}}
|
|
|
|
# Security hardening
|
|
NoNewPrivileges=yes
|
|
ProtectSystem=strict
|
|
ProtectHome=yes
|
|
PrivateTmp=yes
|
|
ProtectKernelTunables=yes
|
|
ProtectKernelModules=yes
|
|
ProtectControlGroups=yes
|
|
RestrictSUIDSGID=yes
|
|
RestrictRealtime=yes
|
|
LockPersonality=yes
|
|
RemoveIPC=yes
|
|
|
|
# Read-write access to catalog for metrics collection
|
|
ReadWritePaths=/var/lib/dbbackup
|
|
|
|
# Network for HTTP server
|
|
RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6
|
|
|
|
# Execution
|
|
ExecStart={{.BinaryPath}} metrics serve --port {{.MetricsPort}}
|
|
ExecReload=/bin/kill -HUP $MAINPID
|
|
Restart=on-failure
|
|
RestartSec=5
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target
|