Handle fallback for invalid loginuid in ui-post-install.sh. (#5099)

This commit is contained in:
Zoltan Papp
2026-01-14 09:53:14 +01:00
committed by GitHub
parent d9118eb239
commit 00b747ad5d

View File

@@ -8,6 +8,10 @@ pid="$(pgrep -x -f /usr/bin/netbird-ui || true)"
if [ -n "${pid}" ]
then
uid="$(cat /proc/"${pid}"/loginuid)"
# loginuid can be 4294967295 (-1) if not set, fall back to process uid
if [ "${uid}" = "4294967295" ] || [ "${uid}" = "-1" ]; then
uid="$(stat -c '%u' /proc/"${pid}")"
fi
username="$(id -nu "${uid}")"
# Only re-run if it was already running
pkill -x -f /usr/bin/netbird-ui >/dev/null 2>&1