Kill TL when ident can't start up (#4512)

Fixes: https://github.com/thelounge/thelounge/issues/4509
This commit is contained in:
Reto 2022-04-12 02:45:36 +02:00 committed by GitHub
parent e362704f6b
commit 37d7de7671
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 2 deletions

View File

@ -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(
{

View File

@ -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);
});