From 16902f3866c610649974f7dba1d231a8b7c04a96 Mon Sep 17 00:00:00 2001 From: Graham Christensen Date: Mon, 5 Apr 2021 15:47:25 +0000 Subject: [PATCH] start-hydra: create a db for the current username Otherwise the logs are spammed with database not existing errors: 15:46:07 postgres.1 | 2021-04-05 15:46:07.631 UTC [30742] FATAL: database grahamc does not exist 15:46:08 postgres.1 | 2021-04-05 15:46:08.641 UTC [30759] FATAL: database grahamc does not exist 15:46:09 postgres.1 | 2021-04-05 15:46:09.650 UTC [30765] FATAL: database grahamc does not exist --- foreman/start-hydra.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/foreman/start-hydra.sh b/foreman/start-hydra.sh index 66773f81..4e348266 100755 --- a/foreman/start-hydra.sh +++ b/foreman/start-hydra.sh @@ -5,6 +5,12 @@ while ! pg_isready -h $(pwd)/.hydra-data/postgres -p 64444; do sleep 1; done createdb -h $(pwd)/.hydra-data/postgres -p 64444 hydra +# create a db for the default user. Not sure why, but +# the terminal is otherwise spammed with: +# +# FATAL: database "USERNAME" does not exist +createdb -h $(pwd)/.hydra-data/postgres -p 64444 "$(whoami)" || true + hydra-init hydra-create-user alice --password foobar --role admin