We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error reports that /var/lib/postgresql/data/ is present but not empty, refuses to start the db.
/var/lib/postgresql/data/
I have been using a container with this feature for months with no problem up until the last week or so, at which point the problem raised its head.
A little digging made me suspect the pq-init.sh entrypoint file.
pq-init.sh
I can't push a branch and submit a PR. So the change I implemented in install.sh is pasted below:
install.sh
setup_pq() { tee /usr/local/share/pq-init.sh << 'EOF' #!/bin/sh set -e version_major=$(psql --version | sed -z "s/psql (PostgreSQL) //g" | grep -Eo -m 1 "^([0-9]+)" | sed -z "s/-//g") if [ ! -f "$PGDATA/PG_VERSION" ]; then echo "Initializing PostgreSQL database..." chown -R postgres:postgres $PGDATA \ && chmod 0750 $PGDATA \ && echo "listen_addresses = '*'" >> /etc/postgresql/${version_major}/main/postgresql.conf \ && echo "data_directory = '$PGDATA'" >> /etc/postgresql/${version_major}/main/postgresql.conf \ && echo "host all all 0.0.0.0/0 trust" > /etc/postgresql/${version_major}/main/pg_hba.conf \ && echo "host all all ::/0 trust" >> /etc/postgresql/${version_major}/main/pg_hba.conf \ && echo "host all all ::1/128 trust" >> /etc/postgresql/${version_major}/main/pg_hba.conf \ && sudo -H -u postgres sh -c "/usr/lib/postgresql/${version_major}/bin/initdb -D $PGDATA --auth-local trust --auth-host scram-sha-256" else echo "PostgreSQL database already initialized, skipping initialization" fi echo "Starting PostgreSQL..." sudo /etc/init.d/postgresql start \ && pg_isready -t 60 set +e # Execute whatever commands were passed in (if any). This allows us # to set this script to ENTRYPOINT while still executing the default CMD. exec "$@" EOF chmod +x /usr/local/share/pq-init.sh \ && chown ${USERNAME}:root /usr/local/share/pq-init.sh }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Error reports that
/var/lib/postgresql/data/
is present but not empty, refuses to start the db.I have been using a container with this feature for months with no problem up until the last week or so, at which point the problem raised its head.
A little digging made me suspect the
pq-init.sh
entrypoint file.I can't push a branch and submit a PR. So the change I implemented in
install.sh
is pasted below:The text was updated successfully, but these errors were encountered: