- boo#1122892: Add a sysconfig variable for initdb.

OBS-URL: https://build.opensuse.org/package/show/server:database:postgresql/postgresql?expand=0&rev=150
This commit is contained in:
Reinhard Max 2023-05-23 12:08:42 +00:00 committed by Git OBS Bridge
parent 3d54e65b53
commit 10c6062196
3 changed files with 24 additions and 2 deletions

View File

@ -5,6 +5,7 @@ test -f $PG_SYSCONFIG && . $PG_SYSCONFIG
eval DATADIR=${POSTGRES_DATADIR:-~postgres/data}
OPTIONS=${POSTGRES_OPTIONS}
INITDB_OPTS=${POSTGRES_INITDB_OPTS}
PIDFILE=$DATADIR/postmaster.pid
#
@ -48,8 +49,8 @@ case "$1" in
if [ ! -f $DATADIR/PG_VERSION ]; then
test -n "$POSTGRES_LANG" && export LC_ALL="$POSTGRES_LANG"
install -d -m 700 ${DATADIR} &&
echo "Initializing PostgreSQL $VERSION at location ${DATADIR}"
/usr/bin/initdb --auth=ident $DATADIR > initlog 2>&1 || {
echo "Initializing PostgreSQL $VERSION at location ${DATADIR} using options \"$INITDB_OPTS\""
/usr/bin/initdb $INITDB_OPTS $DATADIR > initlog 2>&1 || {
echo "Initialisation failed. See $PWD/initlog ."
exit 1
}

View File

@ -49,3 +49,19 @@ POSTGRES_TIMEOUT="600"
# If unset or empty $RC_LANG from /etc/sysconfig/language is used.
#
POSTGRES_LANG=""
## Path: Applications/PostgreSQL
## Description: The PostgreSQL Database System
## Type: string()
## Default: "--auth=ident"
## ServiceRestart: ""
#
# When PostgreSQL gets started while no database cluster exists under
# the directory stored in the POSTGRES_DATADIR variable, the initdb
# tool gets called with that directory to initialize a new cluster.
# Additional options can be passed to initdb via this variable.
# Alternatively initdb can be called manually to initialize the
# database cluster prior to starting the PostgreSQL server for the
# first time.
#
POSTGRES_INITDB_OPTS="--auth=ident"

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Tue May 23 11:45:10 UTC 2023 - Reinhard Max <max@suse.com>
- boo#1122892: Add a sysconfig variable for initdb.
-------------------------------------------------------------------
Mon May 15 14:17:11 UTC 2023 - Reinhard Max <max@suse.com>