diff options
author | zeripath <art27@cantab.net> | 2020-03-23 07:59:38 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-23 07:59:38 +0000 |
commit | 311ed516cef678797df01311a638d1afcadf6d63 (patch) | |
tree | 3c0c161e014534fcb83391ba8130de5f1e94e38f /modules/ssh | |
parent | f036de5a9470f82be11b24e30548316f2f251602 (diff) | |
download | gitea-311ed516cef678797df01311a638d1afcadf6d63.tar.gz gitea-311ed516cef678797df01311a638d1afcadf6d63.zip |
log.Fatal on failure to listen to SSH port (#10795)
Fix #10792
Diffstat (limited to 'modules/ssh')
-rw-r--r-- | modules/ssh/ssh_graceful.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/modules/ssh/ssh_graceful.go b/modules/ssh/ssh_graceful.go index f8370ab4db..a30e6fc297 100644 --- a/modules/ssh/ssh_graceful.go +++ b/modules/ssh/ssh_graceful.go @@ -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) |