logging_ipv{4,6}.conf: detect ulogd2 via systemd instead of ps.

ps also lists the ulogd of LXC containers (which do not receive the NFLOG
packets of the host) and misses ulogd2 if the firewall starts first at boot.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-11 23:17:04 +01:00
co-authored by Claude Opus 5.5
parent affa35def4
commit f0187f041d
2 changed files with 12 additions and 2 deletions
+6 -1
View File
@@ -5,7 +5,12 @@
# --- Logging # --- Logging
# ------------- # -------------
if $(ps -e f | grep -q -E "/usr/sbin/ulogd2?\s" 2>/dev/null) ; then # Use NFLOG only if ulogd2 runs (or will run at boot) on this host itself.
# Not 'ps': on LXC hosts it also lists the ulogd of containers, which do not
# receive the NFLOG packets of the host (other network namespace); at boot
# the firewall may also start before ulogd2.
if systemctl is-enabled --quiet ulogd2 2>/dev/null \
|| systemctl is-active --quiet ulogd2 2>/dev/null ; then
tag_log_prefix="--nflog-prefix" tag_log_prefix="--nflog-prefix"
LOG_TARGET="NFLOG --nflog-group 11" LOG_TARGET="NFLOG --nflog-group 11"
else else
+6 -1
View File
@@ -5,7 +5,12 @@
# --- Logging # --- Logging
# ------------- # -------------
if $(ps -e f | grep -q -E "/usr/sbin/ulogd2?\s" 2>/dev/null) ; then # Use NFLOG only if ulogd2 runs (or will run at boot) on this host itself.
# Not 'ps': on LXC hosts it also lists the ulogd of containers, which do not
# receive the NFLOG packets of the host (other network namespace); at boot
# the firewall may also start before ulogd2.
if systemctl is-enabled --quiet ulogd2 2>/dev/null \
|| systemctl is-active --quiet ulogd2 2>/dev/null ; then
tag_log_prefix="--nflog-prefix" tag_log_prefix="--nflog-prefix"
LOG_TARGET="NFLOG --nflog-group 12" LOG_TARGET="NFLOG --nflog-group 12"
else else