* debian/config.yml.in: Make base data directory a template variable
@DATADIR_BASE@. * debian/pg_createconfig_patroni: Use data_directory setting from /etc/postgresql-common/createcluster.conf as DATADIR_BASE if set.
This commit is contained in:
parent
ae3072dce0
commit
932a1911a8
4
debian/changelog
vendored
4
debian/changelog
vendored
|
@ -5,6 +5,10 @@ patroni (2.0.1-3) UNRELEASED; urgency=medium
|
|||
be misleading.
|
||||
* debian/pg_clonecluster_patroni: After pg_dropcluster, remove
|
||||
postgresql.base.conf as well.
|
||||
* debian/config.yml.in: Make base data directory a template variable
|
||||
@DATADIR_BASE@.
|
||||
* debian/pg_createconfig_patroni: Use data_directory setting from
|
||||
/etc/postgresql-common/createcluster.conf as DATADIR_BASE if set.
|
||||
|
||||
-- Debian PostgreSQL Maintainers <team+postgresql@tracker.debian.org> Thu, 10 Dec 2020 13:33:54 +0100
|
||||
|
||||
|
|
2
debian/config.yml.in
vendored
2
debian/config.yml.in
vendored
|
@ -97,7 +97,7 @@ postgresql:
|
|||
listen: "*:@PORT@"
|
||||
connect_address: @HOSTIP@:@PORT@
|
||||
use_unix_socket: true
|
||||
data_dir: /var/lib/postgresql/@VERSION@/@CLUSTER@
|
||||
data_dir: @DATADIR_BASE@/@VERSION@/@CLUSTER@
|
||||
bin_dir: /usr/lib/postgresql/@VERSION@/bin
|
||||
config_dir: /etc/postgresql/@VERSION@/@CLUSTER@
|
||||
pgpass: /var/lib/postgresql/@VERSION@-@CLUSTER@.pgpass
|
||||
|
|
9
debian/pg_createconfig_patroni
vendored
9
debian/pg_createconfig_patroni
vendored
|
@ -91,6 +91,14 @@ fi
|
|||
# Postgres port. 2576 is 8008 - 5432.
|
||||
API_PORT=$((2576+$PORT))
|
||||
|
||||
# set base data directory
|
||||
if [ -f /etc/postgresql-common/createcluster.conf ]; then
|
||||
DATADIR_BASE=$(grep ^data_directory /etc/postgresql-common/createcluster.conf | sed -e 's/^[^\/]*\//\//g' -e 's/\%.*//' -e 's/\/$//')
|
||||
fi
|
||||
if [ -z "${DATADIR_BASE}" ]; then
|
||||
DATADIR_BASE=/var/lib/postgresql
|
||||
fi
|
||||
|
||||
# check DCS configuration
|
||||
if [ ! -f /etc/patroni/dcs.yml ]; then
|
||||
echo "DCS not configured yet, edit /etc/patroni/dcs.yml"
|
||||
|
@ -204,6 +212,7 @@ cat /etc/patroni/config.yml.in | \
|
|||
-e "s/@HOSTNAME@/${HOSTNAME}/g" \
|
||||
-e "s/@HOSTIP@/${HOSTIP}/g" \
|
||||
-e "s/@LISTEN_VIP@/${LISTEN_VIP}/g" \
|
||||
-e "s#@DATADIR_BASE@#${DATADIR_BASE}#g" \
|
||||
-e "s#@NETWORK@#${NETWORK}#g" \
|
||||
-e "s/@API_PORT@/${API_PORT}/g" \
|
||||
-e "s/@PORT@/${PORT}/g" \
|
||||
|
|
Loading…
Reference in a new issue