[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