fix(proxmox): systemd-Drop-in User=root — pvesh braucht root, Dienst lief als telegraf und lieferte still nichts

This commit is contained in:
mm committed 2026-09-13 21:30:44 +02:00
1 parent d2fa6420be
commit c73e4d1773
1 file changed
+13
+13
View File
@@ -314,6 +314,19 @@ set -a; . /etc/default/telegraf; set +a
# -------------------------------------------------------------------------- # --------------------------------------------------------------------------
# Dienst # Dienst
# -------------------------------------------------------------------------- # --------------------------------------------------------------------------
# Proxmox-Rolle: pvesh verlangt root. Der InfluxData-Dienst laeuft als User
# "telegraf" -> das Script liefert dann still nichts. Drop-in auf root.
if [ "$ROLE" = "proxmox" ] && [ -d /etc/systemd/system ]; then
mkdir -p /etc/systemd/system/telegraf.service.d
cat > /etc/systemd/system/telegraf.service.d/10-proxmox-root.conf <<'EOF'
# pvesh (VM/CT-Metriken) erfordert root-Rechte.
[Service]
User=root
Group=root
EOF
log "Proxmox: systemd-Drop-in gesetzt — Dienst laeuft als root (pvesh braucht root)."
fi
if command -v systemctl >/dev/null && [ -d /run/systemd/system ]; then if command -v systemctl >/dev/null && [ -d /run/systemd/system ]; then
systemctl daemon-reload systemctl daemon-reload
systemctl enable --now telegraf >/dev/null systemctl enable --now telegraf >/dev/null