Skip to content

If dbserver too slow to start, post_start_action() fails #9

@paoloantinori

Description

@paoloantinori

Hi, I want to report a problem that happens on my system but not on a constant base.

Sometimes the scripts are not creating correctly the user.

I have tracked down the reason of the problem to this script

wait_for_postgres_and_run_post_start_action() {
  # Wait for postgres to finish starting up first.
  while [[ ! -e /run/postgresql/9.3-main.pid ]] ; do
inotifywait -q -e create /run/postgresql/ >> /dev/null
  done

post_start_action
}

Apparently the presence of /run/postgresql/9.3-main.pid is not enough to identify Postgres as ready to accept connections.

I have random error and logs shows that post_start_action before all the startup log entries are displayed.

I have also notice that the logic in this fork
https://github.com/waterlink/docker-postgresql/blob/master/scripts/first_run.sh
helps to avoid the problem.

Could you consider to change the "wait" logic?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions