photoprism: run as PID 1 and start PhotoPrism as a service so SIGTERM reaches it (#3183) (#3195)

Without an init key Supervisor runs Docker's tini as PID 1. ha_entrypoint.sh
was then its child, skipped its SIGTERM trap, and died by the default handler
(exit 143) while 99-run.sh still held the cont-init loop with exec nginx, so
PhotoPrism was killed at teardown without its graceful shutdown.

Follow the seerr pattern: init: false, the launch script moves to
services.d/photoprism/run and execs the upstream entrypoint, and nginx gets
its own run file that waits for port 2341. ha_entrypoint.sh then forwards the
stop to each service's process group and exits 0.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
AlexandreandClaude Opus 5.5 authored and GitHub committed 2026-11-04 08:34:50 +01:00
1 parent 086c457003
commit 60fb259196
4 files changed
+17 -9

No files matched your search

+3
View File
@@ -1,3 +1,6 @@
## 2026.10.29.3 (04-11-2026)
- Stop PhotoPrism cleanly: run the add-on's entrypoint as PID 1 (`init: false`) and start PhotoPrism and nginx as services, so a stop now reaches PhotoPrism as SIGTERM and it closes its database before exiting. Previously the stop killed the entrypoint shell (exit code 143) and PhotoPrism was killed without shutting down (#3183)
## 2026.10.29.2 (03-11-2026) ## 2026.10.29.2 (03-11-2026)
- Fix ~5 minute delay before Home Assistant reports the add-on as started: the healthcheck interval was 5 minutes, so when PhotoPrism took longer than the 30 s start period to open its port, the first successful probe came 5 minutes later. Use the standard 5 s interval now that the check is a cheap curl (#3183) - Fix ~5 minute delay before Home Assistant reports the add-on as started: the healthcheck interval was 5 minutes, so when PhotoPrism took longer than the 30 s start period to open its port, the first successful probe came 5 minutes later. Use the standard 5 s interval now that the check is a cheap curl (#3183)
+2 -1
View File
@@ -76,6 +76,7 @@ homeassistant: 0.92.0b2
image: ghcr.io/alexbelgium/photoprism-{arch} image: ghcr.io/alexbelgium/photoprism-{arch}
ingress: true ingress: true
ingress_stream: true ingress_stream: true
init: false
map: map:
- app_config:rw - app_config:rw
- homeassistant_config:rw - homeassistant_config:rw
@@ -131,5 +132,5 @@ services:
slug: photoprism slug: photoprism
udev: true udev: true
url: https://github.com/alexbelgium/hassio-addons url: https://github.com/alexbelgium/hassio-addons
version: "2026.10.29.2" version: "2026.10.29.3"
video: true video: true
+11
View File
@@ -0,0 +1,11 @@
#!/usr/bin/with-contenv bashio
# shellcheck shell=bash
set -e
# ==============================================================================
# Wait for PhotoPrism to become available
bashio::net.wait_for 2341 localhost 900
bashio::log.info "Starting NGinx..."
exec nginx
@@ -148,11 +148,4 @@ fi
bashio::log.info "Please wait 1 or 2 minutes to allow the server to load" bashio::log.info "Please wait 1 or 2 minutes to allow the server to load"
bashio::log.info 'Default username : admin, default password: "please_change_password"' bashio::log.info 'Default username : admin, default password: "please_change_password"'
# shellcheck disable=SC1091 exec /scripts/entrypoint.sh photoprism start
. /scripts/entrypoint.sh photoprism start &
bashio::log.info "Starting, please wait for next green text..."
bashio::net.wait_for 2341 localhost 900
bashio::log.info "App launched"
exec nginx