fix(apache): from_beginning existiert bei inputs.tail nicht (Dienststart scheiterte) + COMMON/COMBINED_LOG_FORMAT; Logpfad-Autoerkennung

This commit is contained in:
mm committed 2026-09-14 00:14:45 +02:00
1 parent feb77e2fc7
commit da3f221c8d
3 files changed
+129 -6

No files matched your search

+19 -1
View File
@@ -44,7 +44,10 @@ ROLE="auto"
PVE_TOKEN="${PVE_TOKEN:-}"
PVE_NODE="${PVE_NODE:-}"
PVE_URL="${PVE_URL:-}"
APACHE_LOG="/var/log/apache2/access.log"
# Apache-Logpfad: Distributionen unterscheiden sich — Debian/Ubuntu/KeyHelp
# nutzen /var/log/apache2/, RHEL/Rocky /var/log/httpd/. Der Installer sucht beim
# ersten Lauf; --apache-log ueberschreibt.
APACHE_LOG=""
TELEGRAF_VERSION="${TELEGRAF_VERSION:-1.40.0}"
# Ueberschreibbar (Tests/Mirror): REPO_RAW=... sh install.sh
REPO_RAW="${REPO_RAW:-https://gitea.m-m.bio/mm/netbird-telegraf-installer/raw/branch/main}"
@@ -149,6 +152,21 @@ elif [ -e /dev/dri/renderD128 ]; then
GPU="intel"
fi
HAS_APACHE=0; { command -v apache2ctl >/dev/null 2>&1 || command -v httpd >/dev/null 2>&1; } && HAS_APACHE=1
# Apache-Logpfad ermitteln: erst explizit gesetzter Wert, dann uebliche Orte,
# dann die von Apache selbst konfigurierte CustomLog-Direktive.
if [ "$HAS_APACHE" -eq 1 ] && [ -z "$APACHE_LOG" ]; then
for _p in /var/log/apache2/access.log /var/log/httpd/access_log \
/var/log/apache2/other_vhosts_access.log /var/log/httpd/access.log; do
[ -r "$_p" ] && { APACHE_LOG="$_p"; break; }
done
if [ -z "$APACHE_LOG" ]; then
# Aus der Config lesen (KeyHelp/Plesk setzen eigene Pfade)
_cl="$(grep -rhoE '^\s*CustomLog\s+\S+' /etc/apache2/ /etc/httpd/ 2>/dev/null \
| awk '{print $2}' | grep -v '^|' | head -1)"
[ -n "$_cl" ] && [ -r "$_cl" ] && APACHE_LOG="$_cl"
fi
[ -n "$APACHE_LOG" ] || APACHE_LOG="/var/log/apache2/access.log"
fi
if [ "$ROLE" = "auto" ]; then
ROLE="none"
[ "$IS_PVE" -eq 1 ] && ROLE="proxmox"