Fix SignalK startup hang on UID/GID remap failure

This commit is contained in:
Alexandre
2026-03-05 11:04:05 +01:00
parent cbf2ecb023
commit 2ffe78d610
3 changed files with 22 additions and 3 deletions

View File

@@ -1,3 +1,6 @@
## 2.22.1-1 (2026-02-25)
- Fix startup hang by handling node UID/GID remap failures gracefully in init script
## 2.22.1 (2026-02-21)
- Update to latest version from SignalK/signalk-server (changelog : https://github.com/SignalK/signalk-server/releases)

View File

@@ -57,5 +57,5 @@ uart: true
udev: true
url: https://github.com/alexbelgium/hassio-addons
usb: true
version: "2.22.1"
version: "2.22.1-1"
webui: http://[HOST]:[PORT:3000]

View File

@@ -16,8 +16,24 @@ chown -R "$USER:$USER" /config
# Set permissions
echo "... setting permissions for node user"
usermod -o -u 0 node
groupmod -o -g 0 node
if id "$USER" &>/dev/null; then
current_uid="$(id -u "$USER")"
current_gid="$(id -g "$USER")"
if [[ "$current_uid" != "0" ]]; then
if ! usermod -o -u 0 "$USER"; then
bashio::log.warning "Failed to set UID 0 for $USER; continuing with UID $current_uid"
fi
fi
if [[ "$current_gid" != "0" ]]; then
if ! groupmod -o -g 0 "$USER"; then
bashio::log.warning "Failed to set GID 0 for $USER; continuing with GID $current_gid"
fi
fi
else
bashio::log.warning "User $USER does not exist; continuing without UID/GID remap"
fi
# Ensure 600 for SSL files
echo "... specifying security files permissions"