diff --git a/config/config_system.go b/config/config_system.go index f946e6c..4451cda 100644 --- a/config/config_system.go +++ b/config/config_system.go @@ -38,6 +38,12 @@ type SystemConfiguration struct { // the user did not press the stop button, but the process stopped cleanly. DetectCleanExitAsCrash bool `default:"true" yaml:"detect_clean_exit_as_crash"` + // If set to true, file permissions for a server will be checked when the process is + // booted. This can cause boot delays if the server has a large amount of files. In most + // cases disabling this should not have any major impact unless external processes are + // frequently modifying a servers' files. + CheckPermissionsOnBoot bool `default:"true" yaml:"check_permissions_on_boot"` + Sftp SftpConfiguration `yaml:"sftp"` } diff --git a/server/power.go b/server/power.go index 99b20bf..9557f04 100644 --- a/server/power.go +++ b/server/power.go @@ -3,6 +3,7 @@ package server import ( "context" "github.com/pkg/errors" + "github.com/pterodactyl/wings/config" "golang.org/x/sync/semaphore" "os" "time" @@ -147,10 +148,12 @@ func (s *Server) onBeforeStart() error { s.PublishConsoleOutputFromDaemon("Updating process configuration files...") s.UpdateConfigurationFiles() - s.PublishConsoleOutputFromDaemon("Ensuring file permissions are set correctly, this could take a few seconds...") - // Ensure all of the server file permissions are set correctly before booting the process. - if err := s.Filesystem.Chown("/"); err != nil { - return errors.Wrap(err, "failed to chown root server directory during pre-boot process") + if config.Get().System.CheckPermissionsOnBoot { + s.PublishConsoleOutputFromDaemon("Ensuring file permissions are set correctly, this could take a few seconds...") + // Ensure all of the server file permissions are set correctly before booting the process. + if err := s.Filesystem.Chown("/"); err != nil { + return errors.Wrap(err, "failed to chown root server directory during pre-boot process") + } } return nil