log.Fatal on failure to listen to SSH port (#10795)

Fix #10792
tokarchuk/v1.17
zeripath 5 years ago committed by GitHub
parent f036de5a94
commit 311ed516ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      modules/ssh/ssh_graceful.go

@ -16,7 +16,12 @@ func listen(server *ssh.Server) {
err := gracefulServer.ListenAndServe(server.Serve) err := gracefulServer.ListenAndServe(server.Serve)
if err != nil { if err != nil {
log.Critical("Failed to start SSH server: %v", err) select {
case <-graceful.GetManager().IsShutdown():
log.Critical("Failed to start SSH server: %v", err)
default:
log.Fatal("Failed to start SSH server: %v", err)
}
} }
log.Info("SSH Listener: %s Closed", server.Addr) log.Info("SSH Listener: %s Closed", server.Addr)

Loading…
Cancel
Save