From f5096d3f088b529a2a090203e46bf1977e0bb2c8 Mon Sep 17 00:00:00 2001 From: bluhm Date: Fri, 7 Apr 2017 15:36:16 +0000 Subject: [PATCH] Incoming TCP connections from clients fill the files of a log server. A log client reconnects at every SIGHUP. Write these accept and close messages with debug priority, then they can be turned on in syslog.conf. Default is off. While there, move a debug message and set the priority of the exit message explicitly to error. OK mpf@ millert@ --- usr.sbin/syslogd/syslogd.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/usr.sbin/syslogd/syslogd.c b/usr.sbin/syslogd/syslogd.c index b1df3dabda2..17b80935d20 100644 --- a/usr.sbin/syslogd/syslogd.c +++ b/usr.sbin/syslogd/syslogd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: syslogd.c,v 1.240 2017/04/05 22:15:35 bluhm Exp $ */ +/* $OpenBSD: syslogd.c,v 1.241 2017/04/07 15:36:16 bluhm Exp $ */ /* * Copyright (c) 1983, 1988, 1993, 1994 @@ -1134,7 +1134,7 @@ acceptcb(int lfd, short event, void *arg, int usetls) p->p_peername = peername; bufferevent_enable(p->p_bufev, EV_READ); - log_info(LOG_INFO, "%s logger \"%s\" accepted", + log_info(LOG_DEBUG, "%s logger \"%s\" accepted", p->p_ctx ? "tls" : "tcp", peername); } @@ -1261,7 +1261,7 @@ tcp_closecb(struct bufferevent *bufev, short event, void *arg) struct peer *p = arg; if (event & EVBUFFER_EOF) { - log_info(LOG_INFO, "%s logger \"%s\" connection close", + log_info(LOG_DEBUG, "%s logger \"%s\" connection close", p->p_ctx ? "tls" : "tcp", p->p_peername); } else { log_info(LOG_NOTICE, "%s logger \"%s\" connection error: %s", @@ -2146,15 +2146,14 @@ void init_signalcb(int signum, short event, void *arg) { init(); - log_info(LOG_INFO, "restart"); - log_debug("syslogd: restarted"); if (tcpbuf_dropped > 0) { log_info(LOG_WARNING, "dropped %d message%s to remote loghost", tcpbuf_dropped, tcpbuf_dropped == 1 ? "" : "s"); tcpbuf_dropped = 0; } + log_debug("syslogd: restarted"); } void @@ -2189,7 +2188,7 @@ die(int signo) } if (signo) - log_warnx("exiting on signal %d", signo); + log_info(LOG_ERR, "exiting on signal %d", signo); log_debug("syslogd: exited"); exit(0); } -- 2.20.1