create /data/database/postgres/ if missing (#273)

fix for issue #271
This commit is contained in:
Robin C. Ladiges 2022-05-02 00:43:17 +02:00 committed by GitHub
parent cffbd7be5b
commit 5572c9722e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

2
run.sh
View File

@ -42,6 +42,8 @@ fi
if [ "$1" == "import" ]; then
# Ensure that database directory is in right state
mkdir -p /data/database/postgres/
chown renderer: /data/database/
chown -R postgres: /var/lib/postgresql /data/database/postgres/
if [ ! -f /data/database/postgres/PG_VERSION ]; then
sudo -u postgres /usr/lib/postgresql/14/bin/pg_ctl -D /data/database/postgres/ initdb -o "--locale C.UTF-8"