Skip to content

Commit

Permalink
log.Fatal on failure to listen to SSH port (#10795)
Browse files Browse the repository at this point in the history
Fix #10792
  • Loading branch information
zeripath authored Mar 23, 2020
1 parent f036de5 commit 311ed51
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion modules/ssh/ssh_graceful.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@ func listen(server *ssh.Server) {

err := gracefulServer.ListenAndServe(server.Serve)
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)

Expand Down

0 comments on commit 311ed51

Please sign in to comment.