From 7051feee01f4b2c4358f91de7eb3524c1ccf4560 Mon Sep 17 00:00:00 2001 From: Dane Everitt Date: Mon, 31 Jan 2022 19:30:07 -0500 Subject: [PATCH] Add additional debug points to server start process --- parser/parser.go | 2 +- server/config_parser.go | 8 ++++++-- server/power.go | 3 +++ 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/parser/parser.go b/parser/parser.go index f5d97f4..9cd4a64 100644 --- a/parser/parser.go +++ b/parser/parser.go @@ -11,9 +11,9 @@ import ( "github.com/apex/log" "github.com/beevik/etree" "github.com/buger/jsonparser" + "github.com/goccy/go-json" "github.com/icza/dyno" "github.com/magiconair/properties" - "github.com/goccy/go-json" "gopkg.in/ini.v1" "gopkg.in/yaml.v2" diff --git a/server/config_parser.go b/server/config_parser.go index 794d6e7..4c51724 100644 --- a/server/config_parser.go +++ b/server/config_parser.go @@ -6,12 +6,14 @@ import ( "github.com/gammazero/workerpool" ) -// Parent function that will update all of the defined configuration files for a server -// automatically to ensure that they always use the specified values. +// UpdateConfigurationFiles updates all of the defined configuration files for +// a server automatically to ensure that they always use the specified values. func (s *Server) UpdateConfigurationFiles() { pool := workerpool.New(runtime.NumCPU()) + s.Log().Debug("acquiring process configuration files...") files := s.ProcessConfiguration().ConfigurationFiles + s.Log().Debug("acquired process configuration files") for _, cf := range files { f := cf @@ -26,6 +28,8 @@ func (s *Server) UpdateConfigurationFiles() { if err := f.Parse(p, false); err != nil { s.Log().WithField("error", err).Error("failed to parse and update server configuration file") } + + s.Log().WithField("path", f.FileName).Debug("finished processing server configuration file") }) } diff --git a/server/power.go b/server/power.go index eb83935..ef30067 100644 --- a/server/power.go +++ b/server/power.go @@ -201,11 +201,14 @@ func (s *Server) onBeforeStart() error { // we don't need to actively do anything about it at this point, worse comes to worst the // server starts in a weird state and the user can manually adjust. s.PublishConsoleOutputFromDaemon("Updating process configuration files...") + s.Log().Debug("updating server configuration files...") s.UpdateConfigurationFiles() + s.Log().Debug("updated server configuration files") if config.Get().System.CheckPermissionsOnBoot { s.PublishConsoleOutputFromDaemon("Ensuring file permissions are set correctly, this could take a few seconds...") // Ensure all the server file permissions are set correctly before booting the process. + s.Log().Debug("chowning server root directory...") if err := s.Filesystem().Chown("/"); err != nil { return errors.WithMessage(err, "failed to chown root server directory during pre-boot process") }