From 96326846cd5733ab87970d41491b109969a902f2 Mon Sep 17 00:00:00 2001 From: Mechiel Lukkien Date: Sun, 2 Jul 2023 14:46:20 +0200 Subject: [PATCH] at startup, print absolute path to config files that we read after a post on HN about how that's useful for services you haven't had to do anything with for a while. will help with debugging in that case. --- serve.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/serve.go b/serve.go index 300a659..39197ff 100644 --- a/serve.go +++ b/serve.go @@ -157,7 +157,12 @@ requested, other TLS certificates are requested on demand. // to start the child process. runtime.GOMAXPROCS(1) - log.Print("starting as root, initializing network listeners", mlog.Field("version", moxvar.Version), mlog.Field("pid", os.Getpid())) + moxconf, err := filepath.Abs(mox.ConfigStaticPath) + log.Check(err, "finding absolute mox.conf path") + domainsconf, err := filepath.Abs(mox.ConfigDynamicPath) + log.Check(err, "finding absolute domains.conf path") + + log.Print("starting as root, initializing network listeners", mlog.Field("version", moxvar.Version), mlog.Field("pid", os.Getpid()), mlog.Field("moxconf", moxconf), mlog.Field("domainsconf", domainsconf)) if os.Getenv("MOX_SOCKETS") != "" { log.Fatal("refusing to start as root with $MOX_SOCKETS set") }