mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-05-19 15:21:50 +02:00
Close postgres cleanly
https://github.com/alexbelgium/hassio-addons/issues/1652
This commit is contained in:
@@ -32,6 +32,14 @@ chmod -R 777 "$CONFIG_HOME"
|
|||||||
# Launch App #
|
# Launch App #
|
||||||
##############
|
##############
|
||||||
|
|
||||||
|
# Function to handle SIGTERM
|
||||||
|
function shutdown_postgres {
|
||||||
|
echo "Received SIGTERM, shutting down PostgreSQL..."
|
||||||
|
pg_ctl -D "$PGDATA" -m fast stop
|
||||||
|
exit 0
|
||||||
|
}
|
||||||
|
trap 'shutdown_postgres' SIGTERM
|
||||||
|
|
||||||
# Go to folder
|
# Go to folder
|
||||||
cd /config || true
|
cd /config || true
|
||||||
|
|
||||||
@@ -41,10 +49,13 @@ echo " "
|
|||||||
|
|
||||||
# Add docker-entrypoint command
|
# Add docker-entrypoint command
|
||||||
if [ "$(bashio::info.arch)" != "armv7" ]; then
|
if [ "$(bashio::info.arch)" != "armv7" ]; then
|
||||||
# Exec vecto modification
|
# Exec vector modification
|
||||||
/./docker-entrypoint-initdb.d/10-vector.sh & \
|
/./docker-entrypoint-initdb.d/10-vector.sh & \
|
||||||
docker-entrypoint.sh postgres -c shared_preload_libraries=vectors.so
|
docker-entrypoint.sh postgres -c shared_preload_libraries=vectors.so &
|
||||||
else
|
else
|
||||||
bashio::log.warning "Your architecture is armv7, pgvecto.rs is disabled as not supported"
|
bashio::log.warning "Your architecture is armv7, pgvecto.rs is disabled as not supported"
|
||||||
docker-entrypoint.sh postgres
|
docker-entrypoint.sh postgres &
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Wait for all background processes to finish
|
||||||
|
wait
|
||||||
|
|||||||
Reference in New Issue
Block a user