environment(docker): improve logging and stacks

This commit is contained in:
Matthew Penner
2023-01-17 11:47:27 -07:00
parent e74d8e3501
commit 9b8b3c90fb
6 changed files with 12 additions and 9 deletions

View File

@@ -6,6 +6,8 @@ import (
"sync"
"time"
"emperror.dev/errors"
"github.com/pterodactyl/wings/config"
"github.com/pterodactyl/wings/environment"
)
@@ -57,7 +59,7 @@ func (s *Server) handleServerCrash() error {
exitCode, oomKilled, err := s.Environment.ExitState()
if err != nil {
return err
return errors.Wrap(err, "failed to get exit state for server process")
}
// If the system is not configured to detect a clean exit code as a crash, and the
@@ -85,5 +87,5 @@ func (s *Server) handleServerCrash() error {
s.crasher.SetLastCrash(time.Now())
return s.HandlePowerAction(PowerActionStart)
return errors.Wrap(s.HandlePowerAction(PowerActionStart), "failed to start server after crash detection")
}

View File

@@ -147,6 +147,7 @@ func (s *Server) Context() context.Context {
// server instance.
func (s *Server) GetEnvironmentVariables() []string {
out := []string{
// TODO: allow this to be overridden by the user.
fmt.Sprintf("TZ=%s", config.Get().System.Timezone),
fmt.Sprintf("STARTUP=%s", s.Config().Invocation),
fmt.Sprintf("SERVER_MEMORY=%d", s.MemoryLimit()),