mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-06-16 04:19:13 +02:00
Re-add trap
This commit is contained in:
@@ -34,6 +34,14 @@ cd /config || true
|
|||||||
|
|
||||||
bashio::log.info "Starting the app"
|
bashio::log.info "Starting the app"
|
||||||
|
|
||||||
|
function shutdown_postgres {
|
||||||
|
echo "Received SIGTERM/SIGINT, shutting down PostgreSQL..."
|
||||||
|
gosu postgres pg_ctl -D "$PGDATA" -m fast stop
|
||||||
|
exit 0
|
||||||
|
}
|
||||||
|
|
||||||
|
trap 'shutdown_postgres' SIGTERM SIGINT
|
||||||
|
|
||||||
# Start background tasks
|
# Start background tasks
|
||||||
if [ "$(bashio::info.arch)" != "armv7" ]; then
|
if [ "$(bashio::info.arch)" != "armv7" ]; then
|
||||||
/./docker-entrypoint-initdb.d/10-vector.sh & VECTOR_PID=$!
|
/./docker-entrypoint-initdb.d/10-vector.sh & VECTOR_PID=$!
|
||||||
@@ -43,6 +51,3 @@ else
|
|||||||
bashio::log.warning "ARMv7 detected: Starting without vectors.so"
|
bashio::log.warning "ARMv7 detected: Starting without vectors.so"
|
||||||
docker-entrypoint.sh postgres & POSTGRES_PID=$!
|
docker-entrypoint.sh postgres & POSTGRES_PID=$!
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Wait for processes to finish
|
|
||||||
# wait "$VECTOR_PID" "$POSTGRES_PID"
|
|
||||||
|
|||||||
Reference in New Issue
Block a user