Count merged-usr units once and accept guests without ss or netstat

- /lib/systemd/system is skipped when it is the same directory as /usr/lib/systemd/system
- A guest without ss or netstat has no listener evidence instead of an incomplete scan
- Spanish messages for native discovery
This commit is contained in:
MacRimi
2026-10-18 12:05:11 +02:00
parent ccdc21504a
commit 8757bbeb4f
3 changed files with 36 additions and 1 deletions
+4 -1
View File
@@ -146,6 +146,8 @@ SERVICE_SCRIPT = r'''
command -v awk >/dev/null && command -v head >/dev/null || exit 1
n=0
for dir in /etc/systemd/system /usr/lib/systemd/system /lib/systemd/system /etc/init.d; do
# With a merged /usr, /lib is /usr/lib: the same units must not count twice.
[ "$dir" = /lib/systemd/system ] && [ /lib/systemd/system -ef /usr/lib/systemd/system ] && continue
[ ! -d "$dir" ] || [ -r "$dir" ] || exit 1
for f in "$dir"/*; do
[ -f "$f" ] || continue
@@ -204,7 +206,8 @@ elif command -v netstat >/dev/null; then
pid=$7; sub(/\/.*$/,"",pid); if(pid ~ /^[0-9]+$/) printf "L\t%s\t%s\n",pid,port}
END {print failed ? "FAILED" : (limited ? "LIMIT" : "END")}'
else
exit 1
# Without ss or netstat there is no listener evidence; a retry would not change it.
printf 'END\n'
fi
'''
HESTIA_PANEL_SCRIPT = r'''