[Unit] Description=VW EU Data Act Prometheus Exporter After=network-online.target Wants=network-online.target [Service] Type=simple User=prometheus Group=prometheus WorkingDirectory=/opt/vw-eu-data-act-exporter ExecStart=/opt/vw-eu-data-act-exporter/venv/bin/python3 /opt/vw-eu-data-act-exporter/vw-eu-data-act-exporter.py Restart=on-failure RestartSec=30 # Hardening # StateDirectory is created automatically (with correct ownership) before # the service starts and is writable under ProtectSystem=strict without a # ReadWritePaths= entry - systemd exposes its absolute path via # $STATE_DIRECTORY, which config.py picks up for persist_raw_json_dir. # Unlike ReadWritePaths=, this does not require the directory to already # exist on disk. StateDirectory=vw-eu-data-act-exporter NoNewPrivileges=true ProtectSystem=strict ProtectHome=true PrivateTmp=true PrivateDevices=true ProtectKernelTunables=true ProtectKernelModules=true ProtectControlGroups=true RestrictSUIDSGID=true [Install] WantedBy=multi-user.target