#!/bin/sh # felhom-samba entrypoint (R-7 slice 1). A dumb supervisor: smb.conf is bind-mounted # READ-ONLY by the controller, so nothing here templates config or bakes a secret. It # only ensures the household unix user exists (uid:gid 1000) and launches the three # discovery daemons. Verdict source: SPIKE-lan-discovery-2026-07-18 (S4/S4b). set -e FELHOM_UID="${FELHOM_UID:-1000}" FELHOM_GID="${FELHOM_GID:-1000}" SERVER_NAME="${FELHOM_SERVER_NAME:-FELHOM}" IFACE="${FELHOM_IFACE:-eth0}" # Household group/user at uid:gid 1000 — files written over SMB then match the app + # backup ownership convention (smb.conf sets `force user = felhom` per share). if ! getent group "$FELHOM_GID" >/dev/null 2>&1; then addgroup -g "$FELHOM_GID" felhom 2>/dev/null || true fi GRP_NAME="$(getent group "$FELHOM_GID" 2>/dev/null | cut -d: -f1)" [ -z "$GRP_NAME" ] && GRP_NAME=felhom if ! getent passwd "$FELHOM_UID" >/dev/null 2>&1; then adduser -D -H -u "$FELHOM_UID" -G "$GRP_NAME" -s /sbin/nologin felhom 2>/dev/null || true fi mkdir -p /var/lib/samba/private /run/samba echo "[felhom-samba] launching nmbd + wsdd + smbd (server=${SERVER_NAME} iface=${IFACE} uid=${FELHOM_UID})" # nmbd: NetBIOS flat-name resolution so \\ resolves and mounts (the S4b fix). nmbd --daemon --no-process-group # wsdd: WS-Discovery so the box appears in Windows Explorer's Network view. wsdd -i "$IFACE" -4 -H 4 -s -n "$SERVER_NAME" -w WORKGROUP & # smbd in the foreground = the container's main process. exec smbd --foreground --no-process-group