diff --git a/entrypoint.sh b/entrypoint.sh index d8c73e2..54dcbd4 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -40,6 +40,13 @@ fi # Write the password with MD5 encryption, to avoid printing it during startup. # Notice that `docker inspect` will show unencrypted env variables. _AUTH_FILE="${AUTH_FILE:-$PG_CONFIG_DIR/userlist.txt}" + +# Workaround userlist.txt missing issue +# https://github.com/edoburu/docker-pgbouncer/issues/33 +if [ ! -e "${_AUTH_FILE}" ]; then + touch "${_AUTH_FILE}" +fi + if [ -n "$DB_USER" -a -n "$DB_PASSWORD" -a -e "${_AUTH_FILE}" ] && ! grep -q "^\"$DB_USER\"" "${_AUTH_FILE}"; then if [ "$AUTH_TYPE" != "plain" ]; then pass="md5$(echo -n "$DB_PASSWORD$DB_USER" | md5sum | cut -f 1 -d ' ')"