[Nix-dev] postgresql psql hack waiting for startup

Marc Weber marco-oweber at gmx.de
Tue Feb 28 05:57:08 CET 2012


  # We'd like to use the `-w' flag here to wait until the
  # database is up, but it requires a `postgres' user to
  # exist.  And we can't call `createuser' before the
  # database is running.
  ${run} -c '${postgresql}/bin/pg_ctl start -o "${toString flags}"'

Why not create the postgres user then and map root to postgres using
ident file? Isn't this the default user for bootstrapping anyway?

zabbix is the only service I which depends on knowing wheter postgresql
started up.

Also if the hba file or ident file contains syntax errors the preStart
job doesn't finish - leaving upstart in a strange state. (You can kill
it manually)

If postgresql dies (for whatever reason) upstart won't notice.

Marc Weber


More information about the nix-dev mailing list