diff --git a/entrypoint.sh b/entrypoint.sh index da2d971d2..3ca98fa54 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -9,9 +9,9 @@ PGID=${PGID:-1000} BASE_DIR=/app/ComfyUI CUSTOM_NODES_DIR="$BASE_DIR/custom_nodes" -# If running as root, map to requested UID/GID, fix ownership, and make system install targets writable +# If running as root, map to requested UID/GID, fix ownership, and make Python install targets writable if [ "$(id -u)" = "0" ]; then - # Map group + # Map group to PGID if it already exists, otherwise remap the named group if getent group "${PGID}" >/dev/null; then EXISTING_GRP="$(getent group "${PGID}" | cut -d: -f1)" usermod -g "${EXISTING_GRP}" "${APP_USER}" || true @@ -20,7 +20,7 @@ if [ "$(id -u)" = "0" ]; then groupmod -o -g "${PGID}" "${APP_GROUP}" || true fi - # Map user + # Map user to PUID usermod -o -u "${PUID}" "${APP_USER}" || true # Ensure home and app dir exist and are owned @@ -29,19 +29,24 @@ if [ "$(id -u)" = "0" ]; then [ -e "$d" ] && chown -R "${APP_USER}:${APP_GROUP}" "$d" || true done - # Make Python "system" install targets writable for the runtime user - # This covers packages (purelib/platlib), console scripts (scripts), and headers (include/platinclude) - # Discard anything not under /usr/local to avoid over-broad changes. + # Make Python system install targets writable for the runtime user + # Includes: site-packages (purelib/platlib), scripts, headers, data, and data/share(+man1) + # Discards anything not under /usr/local to avoid over-broad changes. readarray -t PY_PATHS < <(python - <<'PY' -import sysconfig -keys = ("purelib","platlib","scripts","include","platinclude") +import sysconfig, os +keys = ("purelib","platlib","scripts","include","platinclude","data") p = sysconfig.get_paths() for k in keys: v = p.get(k) if v: print(v) +d = p.get("data") +if d: + # Wheel .data/data payloads commonly land under {data}/share, including manpages like ttx.1 + print(os.path.join(d, "share")) + print(os.path.join(d, "share", "man", "man1")) PY - ) +) for d in "${PY_PATHS[@]}"; do case "$d" in /usr/local/*)