Skip to content

Commit

Permalink
update again for bugfix initdb
Browse files Browse the repository at this point in the history
  • Loading branch information
balinorLiang committed Oct 28, 2024
1 parent 884859a commit f2cc2f1
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
4 changes: 3 additions & 1 deletion 3/bookworm/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,9 @@ docker_init_database_dir() {
# --pwfile refuses to handle a properly-empty file (hence the "\n"): https://github.com/docker-library/postgres/issues/1025
eval 'initdb --username="$IVORYSQL_USER" --pwfile=<(printf "%s\n" "$IVORYSQL_PASSWORD") '"$POSTGRES_INITDB_ARGS"' "$@"'
sed -ri "s!^#?(listen_addresses)\s*=\s*\S+.*!\1 = '*'!" $PGDATA/postgresql.conf
sed -ri "s!^#?(ivorysql.listen_addresses)\s*=\s*\S+.*!\1 = '*'!" $PGDATA/ivorysql.conf
if [ -e "$PGDATA/ivorysql.conf" ]; then
sed -ri "s!^#?(ivorysql.listen_addresses)\s*=\s*\S+.*!\1 = '*'!" $PGDATA/ivorysql.conf
fi
# unset/cleanup "nss_wrapper" bits
if [[ "${LD_PRELOAD:-}" == */libnss_wrapper.so ]]; then
rm -f "$NSS_WRAPPER_PASSWD" "$NSS_WRAPPER_GROUP"
Expand Down
4 changes: 3 additions & 1 deletion 3/ubi8/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,9 @@ docker_init_database_dir() {
# --pwfile refuses to handle a properly-empty file (hence the "\n"): https://github.com/docker-library/postgres/issues/1025
eval 'initdb --username="$IVORYSQL_USER" --pwfile=<(printf "%s\n" "$IVORYSQL_PASSWORD") '"$POSTGRES_INITDB_ARGS"' "$@"'
sed -ri "s!^#?(listen_addresses)\s*=\s*\S+.*!\1 = '*'!" $PGDATA/postgresql.conf
sed -ri "s!^#?(ivorysql.listen_addresses)\s*=\s*\S+.*!\1 = '*'!" $PGDATA/ivorysql.conf
if [ -e "$PGDATA/ivorysql.conf" ]; then
sed -ri "s!^#?(ivorysql.listen_addresses)\s*=\s*\S+.*!\1 = '*'!" $PGDATA/ivorysql.conf
fi
# unset/cleanup "nss_wrapper" bits
if [[ "${LD_PRELOAD:-}" == */libnss_wrapper.so ]]; then
rm -f "$NSS_WRAPPER_PASSWD" "$NSS_WRAPPER_GROUP"
Expand Down
5 changes: 4 additions & 1 deletion docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,10 @@ docker_init_database_dir() {
# --pwfile refuses to handle a properly-empty file (hence the "\n"): https://github.com/docker-library/postgres/issues/1025
eval 'initdb --username="$IVORYSQL_USER" --pwfile=<(printf "%s\n" "$IVORYSQL_PASSWORD") '"$POSTGRES_INITDB_ARGS"' "$@"'
sed -ri "s!^#?(listen_addresses)\s*=\s*\S+.*!\1 = '*'!" $PGDATA/postgresql.conf
sed -ri "s!^#?(ivorysql.listen_addresses)\s*=\s*\S+.*!\1 = '*'!" $PGDATA/ivorysql.conf
if [ -e "$PGDATA/ivorysql.conf" ]; then
sed -ri "s!^#?(ivorysql.listen_addresses)\s*=\s*\S+.*!\1 = '*'!" $PGDATA/ivorysql.conf
fi

# unset/cleanup "nss_wrapper" bits
if [[ "${LD_PRELOAD:-}" == */libnss_wrapper.so ]]; then
rm -f "$NSS_WRAPPER_PASSWD" "$NSS_WRAPPER_GROUP"
Expand Down

0 comments on commit f2cc2f1

Please sign in to comment.