Restore dns on unclean shutdown (#1494)

This commit is contained in:
Viktor Liu
2024-01-30 09:58:56 +01:00
committed by GitHub
parent 9c56f74235
commit 846d486366
29 changed files with 660 additions and 143 deletions

View File

@@ -142,12 +142,15 @@ func (s *DefaultServer) Initialize() (err error) {
if s.permanent {
err = s.service.Listen()
if err != nil {
return err
return fmt.Errorf("service listen: %w", err)
}
}
s.hostManager, err = s.initialize()
return err
if err != nil {
return fmt.Errorf("initialize: %w", err)
}
return nil
}
// DnsIP returns the DNS resolver server IP address
@@ -225,7 +228,7 @@ func (s *DefaultServer) UpdateDNSServer(serial uint64, update nbdns.Config) erro
}
if err := s.applyConfiguration(update); err != nil {
return err
return fmt.Errorf("apply configuration: %w", err)
}
s.updateSerial = serial