From 21403479e764bf3ff66c5cb50cb9b22c69574281 Mon Sep 17 00:00:00 2001 From: Brett Henderson Date: Sat, 28 Dec 2024 14:42:38 +1100 Subject: [PATCH] Upgrade test db server from Fedora 38 to 41 --- build-support/docker/db/Dockerfile | 2 +- build-support/docker/db/docker-start.sh | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/build-support/docker/db/Dockerfile b/build-support/docker/db/Dockerfile index 27f083cc5..c539af3ef 100644 --- a/build-support/docker/db/Dockerfile +++ b/build-support/docker/db/Dockerfile @@ -1,4 +1,4 @@ -FROM fedora:38 +FROM fedora:41 # Install UTF8 locale support RUN dnf install -y glibc-langpack-en diff --git a/build-support/docker/db/docker-start.sh b/build-support/docker/db/docker-start.sh index 074b691d7..67098a3e9 100755 --- a/build-support/docker/db/docker-start.sh +++ b/build-support/docker/db/docker-start.sh @@ -1,9 +1,16 @@ -#!/bin/bash +#!/usr/bin/env bash + +set -euo pipefail DATADIR="/var/lib/pgsql/data" # test if DATADIR has content if [ ! "$(ls -A $DATADIR)" ]; then + # Create directory for the pgsql lock file. If we don't create this the lock file creation fails and the server startup fails. + # This has only been required since Fedora 41 (not required in Fedora 38). + mkdir /var/run/postgresql + chown postgres:postgres /var/run/postgresql + echo "Initializing Postgres Database at $DATADIR" su postgres sh -lc "initdb --encoding=UTF-8 --locale=en_US.UTF-8"