kopia lustrzana https://github.com/kartoza/docker-postgis
Implement conf lock file check (#116)
It will make sure that the conf file will only be generated once for a given container.pull/117/head
rodzic
2cb86dc2c6
commit
42be2693c5
|
@ -0,0 +1 @@
|
||||||
|
.gitignore
|
|
@ -2,6 +2,11 @@
|
||||||
|
|
||||||
source /env-data.sh
|
source /env-data.sh
|
||||||
|
|
||||||
|
SETUP_LOCKFILE="${ROOT_CONF}/.postgresql.conf.lock"
|
||||||
|
if [ -f "${SETUP_LOCKFILE}" ]; then
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
# This script will setup necessary configuration to enable replications
|
# This script will setup necessary configuration to enable replications
|
||||||
|
|
||||||
# Refresh configuration in case environment settings changed.
|
# Refresh configuration in case environment settings changed.
|
||||||
|
@ -32,3 +37,5 @@ EOF
|
||||||
echo "kernel.shmmax=543252480" >> /etc/sysctl.conf
|
echo "kernel.shmmax=543252480" >> /etc/sysctl.conf
|
||||||
echo "kernel.shmall=2097152" >> /etc/sysctl.conf
|
echo "kernel.shmall=2097152" >> /etc/sysctl.conf
|
||||||
|
|
||||||
|
# Put lock file to make sure conf was not reinitialized
|
||||||
|
touch ${SETUP_LOCKFILE}
|
||||||
|
|
|
@ -2,6 +2,11 @@
|
||||||
|
|
||||||
source /env-data.sh
|
source /env-data.sh
|
||||||
|
|
||||||
|
SETUP_LOCKFILE="${ROOT_CONF}/.pg_hba.conf.lock"
|
||||||
|
if [ -f "${SETUP_LOCKFILE}" ]; then
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
# This script will setup pg_hba.conf
|
# This script will setup pg_hba.conf
|
||||||
|
|
||||||
# Reconfigure pg_hba if environment settings changed
|
# Reconfigure pg_hba if environment settings changed
|
||||||
|
@ -46,3 +51,6 @@ if [[ -z "$REPLICATE_FROM" ]]; then
|
||||||
echo "Add rule to pg_hba: replication user"
|
echo "Add rule to pg_hba: replication user"
|
||||||
echo "host replication all 0.0.0.0/0 $authMethod" >> ${ROOT_CONF}/pg_hba.conf
|
echo "host replication all 0.0.0.0/0 $authMethod" >> ${ROOT_CONF}/pg_hba.conf
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Put lock file to make sure conf was not reinitialized
|
||||||
|
touch ${SETUP_LOCKFILE}
|
||||||
|
|
|
@ -2,6 +2,11 @@
|
||||||
|
|
||||||
source /env-data.sh
|
source /env-data.sh
|
||||||
|
|
||||||
|
SETUP_LOCKFILE="${ROOT_CONF}/.ssl.conf.lock"
|
||||||
|
if [ -f "${SETUP_LOCKFILE}" ]; then
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
# This script will setup default SSL config
|
# This script will setup default SSL config
|
||||||
|
|
||||||
# /etc/ssl/private can't be accessed from within container for some reason
|
# /etc/ssl/private can't be accessed from within container for some reason
|
||||||
|
@ -24,3 +29,6 @@ echo "ssl_cert_file = '/etc/ssl/certs/ssl-cert-snakeoil.pem'" >> $CONF
|
||||||
echo "ssl_key_file = '/etc/ssl/private/ssl-cert-snakeoil.key'" >> $CONF
|
echo "ssl_key_file = '/etc/ssl/private/ssl-cert-snakeoil.key'" >> $CONF
|
||||||
#echo "ssl_ca_file = '' # (change requires restart)" >> $CONF
|
#echo "ssl_ca_file = '' # (change requires restart)" >> $CONF
|
||||||
#echo "ssl_crl_file = ''" >> $CONF
|
#echo "ssl_crl_file = ''" >> $CONF
|
||||||
|
|
||||||
|
# Put lock file to make sure conf was not reinitialized
|
||||||
|
touch ${SETUP_LOCKFILE}
|
||||||
|
|
Ładowanie…
Reference in New Issue