From 37d7de7671cf07f8a7fb3a8b3ea32122a738b646 Mon Sep 17 00:00:00 2001 From: Reto Date: Tue, 12 Apr 2022 02:45:36 +0200 Subject: [PATCH] Kill TL when ident can't start up (#4512) Fixes: https://github.com/thelounge/thelounge/issues/4509 --- src/identification.js | 4 +++- src/server.js | 7 ++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/identification.js b/src/identification.js index 2271013d..5ddc06cf 100644 --- a/src/identification.js +++ b/src/identification.js @@ -27,7 +27,9 @@ class Identification { const server = net.createServer(this.serverConnection.bind(this)); - server.on("error", (err) => log.error(`Identd server error: ${err}`)); + server.on("error", (err) => { + startedCallback(this, err); + }); server.listen( { diff --git a/src/server.js b/src/server.js index f90e50b7..640b8742 100644 --- a/src/server.js +++ b/src/server.js @@ -199,7 +199,12 @@ module.exports = function (options = {}) { Helper.config.themeColor = defaultTheme.themeColor; } - new Identification((identHandler) => { + new Identification((identHandler, err) => { + if (err) { + log.error(`Could not start identd server, ${err.message}`); + process.exit(1); + } + manager.init(identHandler, sockets); });