From: Jeremy Harris Date: Wed, 8 Mar 2017 16:01:54 +0000 (+0000) Subject: Shorten long daemon-startup log lines X-Git-Tag: exim-4_90_RC1~225 X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=fc3f96af4e6c7f4ffe6612b705849d7860ab3cd0;p=exim.git Shorten long daemon-startup log lines --- diff --git a/doc/doc-txt/ChangeLog b/doc/doc-txt/ChangeLog index 8462107c7..0baa1dc67 100644 --- a/doc/doc-txt/ChangeLog +++ b/doc/doc-txt/ChangeLog @@ -26,6 +26,10 @@ JH/03 Rework the transport continued-connection mechanism: when TLS is active, affected: the continued delivery log lines do not have any DNSSEC, TLS cipher, Certificate or OCSP information. +JH/04 Shorten the log line for daemon startup by collapsing adjacent sets of + identical IP addresses on different listening ports. Will also affect + "exiwhat" output. + Exim version 4.89 ----------------- diff --git a/src/src/daemon.c b/src/src/daemon.c index d7f579235..ebd06b523 100644 --- a/src/src/daemon.c +++ b/src/src/daemon.c @@ -1687,6 +1687,16 @@ else if (daemon_listen) } else if (ipa->address[0] == 0) (void)sprintf(CS p, " port %d (IPv4)", ipa->port); + else if ( i > 0 + && host_is_tls_on_connect_port(ipa[-1].port) == (j > 0) + && Ustrcmp(ipa->address, ipa[-1].address) == 0 + ) + { + if (p[-1] == '}') p--; + while (isdigit(*--p)) ; + (void)sprintf(CS p+1, "%s%d,%d}", *p == ',' ? "" : "{", + ipa[-1].port, ipa->port); + } else (void)sprintf(CS p, " [%s]:%d", ipa->address, ipa->port); while (*p != 0) p++; diff --git a/test/log/0282 b/test/log/0282 index 0f71226c4..1ec1eacc2 100644 --- a/test/log/0282 +++ b/test/log/0282 @@ -6,6 +6,6 @@ 1999-03-02 09:44:33 End queue run: pid=pppp ******** SERVER ******** -1999-03-02 09:44:33 exim x.yz daemon started: pid=pppp, no queue runs, listening for SMTP on [127.0.0.1]:1225 [127.0.0.1]:1226 [ip4.ip4.ip4.ip4]:1227 +1999-03-02 09:44:33 exim x.yz daemon started: pid=pppp, no queue runs, listening for SMTP on [127.0.0.1]:{1225,1226} [ip4.ip4.ip4.ip4]:1227 1999-03-02 09:44:33 10HmaX-0005vi-00 <= userx@test.ex H=(rhu.barb) [127.0.0.1]:1111 I=[127.0.0.1]:1225 P=esmtp S=sss 1999-03-02 09:44:33 10HmaY-0005vi-00 <= userx@test.ex H=(rhu.barb) [127.0.0.1]:1112 I=[127.0.0.1]:1226 P=esmtp S=sss diff --git a/test/log/1007 b/test/log/1007 index bc6a29644..54ccb2d7f 100644 --- a/test/log/1007 +++ b/test/log/1007 @@ -4,7 +4,7 @@ 1999-03-02 09:44:33 exim x.yz daemon started: pid=pppp, no queue runs, listening for SMTP on port 1225 (IPv6 and IPv4) port 1226 (IPv6 and IPv4) 1999-03-02 09:44:33 exim x.yz daemon started: pid=pppp, no queue runs, listening for SMTP on port 1225 (IPv6 and IPv4) port 1226 (IPv6 and IPv4) [127.0.0.1]:1228 1999-03-02 09:44:33 exim x.yz daemon started: pid=pppp, no queue runs, listening for SMTP on port 1225 (IPv6 and IPv4) port 1226 (IPv6 and IPv4) [127.0.0.1]:1228 -1999-03-02 09:44:33 exim x.yz daemon started: pid=pppp, no queue runs, listening for SMTP on [ip6:ip6:ip6:ip6:ip6:ip6:ip6:ip6]:1225 [ip6:ip6:ip6:ip6:ip6:ip6:ip6:ip6]:1226 +1999-03-02 09:44:33 exim x.yz daemon started: pid=pppp, no queue runs, listening for SMTP on [ip6:ip6:ip6:ip6:ip6:ip6:ip6:ip6]:{1225,1226} 1999-03-02 09:44:33 exim x.yz daemon started: pid=pppp, no queue runs, listening for SMTP on port 1227 (IPv6 and IPv4) [127.0.0.1]:1228 -1999-03-02 09:44:33 exim x.yz daemon started: pid=pppp, no queue runs, listening for SMTP on [127.0.0.1]:1227 [127.0.0.1]:1225 +1999-03-02 09:44:33 exim x.yz daemon started: pid=pppp, no queue runs, listening for SMTP on [127.0.0.1]:{1227,1225} 1999-03-02 09:44:33 exim x.yz daemon started: pid=pppp, no queue runs, listening for SMTP on port 1225 (IPv6 and IPv4) port 1226 (IPv4) diff --git a/test/stderr/1007 b/test/stderr/1007 index ba0d9a464..66d1ee7de 100644 --- a/test/stderr/1007 +++ b/test/stderr/1007 @@ -84,8 +84,8 @@ pid written to TESTSUITE/spool/exim-daemon.pid changed uid/gid: running as a daemon uid=EXIM_UID gid=EXIM_GID pid=pppp LOG: MAIN - exim x.yz daemon started: pid=pppp, no queue runs, listening for SMTP on [ip6:ip6:ip6:ip6:ip6:ip6:ip6:ip6]:1225 [ip6:ip6:ip6:ip6:ip6:ip6:ip6:ip6]:1226 -set_process_info: pppp daemon(x.yz): no queue runs, listening for SMTP on [ip6:ip6:ip6:ip6:ip6:ip6:ip6:ip6]:1225 [ip6:ip6:ip6:ip6:ip6:ip6:ip6:ip6]:1226 + exim x.yz daemon started: pid=pppp, no queue runs, listening for SMTP on [ip6:ip6:ip6:ip6:ip6:ip6:ip6:ip6]:{1225,1226} +set_process_info: pppp daemon(x.yz): no queue runs, listening for SMTP on [ip6:ip6:ip6:ip6:ip6:ip6:ip6:ip6]:{1225,1226} daemon running with uid=EXIM_UID gid=EXIM_GID euid=EXIM_UID egid=EXIM_GID Listening... Exim version x.yz .... @@ -123,8 +123,8 @@ pid written to TESTSUITE/spool/exim-daemon.pid changed uid/gid: running as a daemon uid=EXIM_UID gid=EXIM_GID pid=pppp LOG: MAIN - exim x.yz daemon started: pid=pppp, no queue runs, listening for SMTP on [127.0.0.1]:1227 [127.0.0.1]:1225 -set_process_info: pppp daemon(x.yz): no queue runs, listening for SMTP on [127.0.0.1]:1227 [127.0.0.1]:1225 + exim x.yz daemon started: pid=pppp, no queue runs, listening for SMTP on [127.0.0.1]:{1227,1225} +set_process_info: pppp daemon(x.yz): no queue runs, listening for SMTP on [127.0.0.1]:{1227,1225} daemon running with uid=EXIM_UID gid=EXIM_GID euid=EXIM_UID egid=EXIM_GID Listening... Exim version x.yz ....