From da8203a816e7d32a08b1a05af847a87122447654 Mon Sep 17 00:00:00 2001 From: jwd Date: Sun, 26 May 2002 04:43:26 +0000 Subject: Log invalid config entries. Make the -d option actually log to the terminal(-d fix from dwmalone). Approved by: dwmalone MFC after: 2 weeks --- usr.sbin/inetd/inetd.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'usr.sbin') diff --git a/usr.sbin/inetd/inetd.c b/usr.sbin/inetd/inetd.c index 57eae26..ee6e8b6 100644 --- a/usr.sbin/inetd/inetd.c +++ b/usr.sbin/inetd/inetd.c @@ -317,7 +317,7 @@ main(argc, argv) const char *servname; int error; - openlog("inetd", LOG_PID | LOG_NOWAIT, LOG_DAEMON); + openlog("inetd", LOG_PID | LOG_NOWAIT | LOG_PERROR, LOG_DAEMON); while ((ch = getopt(argc, argv, "dlwWR:a:c:C:p:")) != -1) switch(ch) { @@ -434,6 +434,9 @@ main(argc, argv) if (daemon(0, 0) < 0) { syslog(LOG_WARNING, "daemon(0,0) failed: %m"); } + /* From now on we don't want syslog messages going to stderr. */ + closelog(); + openlog("inetd", LOG_PID | LOG_NOWAIT, LOG_DAEMON); /* * In case somebody has started inetd manually, we need to * clear the logname, so that old servers run as root do not @@ -1613,7 +1616,7 @@ more: } if (strncmp(sep->se_proto, "rpc/", 4) == 0) { if (no_v4bind != 0) { - syslog(LOG_INFO, "IPv4 bind is ignored for %s", + syslog(LOG_NOTICE, "IPv4 bind is ignored for %s", sep->se_service); freeconfig(sep); goto more; @@ -1654,7 +1657,7 @@ more: #ifdef INET6 if (sep->se_proto[strlen(sep->se_proto) - 1] == '6') { if (no_v6bind != 0) { - syslog(LOG_INFO, "IPv6 bind is ignored for %s", + syslog(LOG_NOTICE, "IPv6 bind is ignored for %s", sep->se_service); freeconfig(sep); goto more; @@ -1686,7 +1689,7 @@ more: #endif { /* default to v4 bind if not v6 bind */ if (no_v4bind != 0) { - syslog(LOG_INFO, "IPv4 bind is ignored for %s", + syslog(LOG_NOTICE, "IPv4 bind is ignored for %s", sep->se_service); freeconfig(sep); goto more; -- cgit v1.1