FATAL: the database system is starting up

OK, I found the following:

  • I was using devicemapper, and there is a bug in the launcher code which would detect it
  • Reinstalled on a new VPS. Using Ubuntu 16.04 LTS this time. Docker driver is aufs!
  • Copied over the standalone folder.
  • Run rebuild.
  • Same error!

Full log here:
https://gist.github.com/hyperknot/90925e5201b00624f56610638b0a6275

I believe that sleep 5 line might be very small, and need to be changed either to a higher value, or a while loop which detects if postgres is up.