Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 12 Aug 2004 01:09:07 GMT
From:      "David S. Wang" <dsw@juniper.net>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   bin/70335: inconsistent syslog behavior when max children configured in inetd.conf
Message-ID:  <200408120109.i7C197OF046848@www.freebsd.org>
Resent-Message-ID: <200408120110.i7C1AHa2011207@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         70335
>Category:       bin
>Synopsis:       inconsistent syslog behavior when max children configured in inetd.conf
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Aug 12 01:10:17 GMT 2004
>Closed-Date:
>Last-Modified:
>Originator:     David S. Wang
>Release:        4.7-RELEASE
>Organization:
Juniper Networks
>Environment:
FreeBSD blah.juniper.net 4.7-RELEASE FreeBSD 4.7-RELEASE #0: Thu Nov  6 00:57:58 GMT 2003     dsw@blah.juniper.net:/usr/src/sys/compile/GENERIC-DDB  i386

>Description:
When a service has a maximum number of children configured in inetd.conf, I have found that, when the service exits due to a signal or with a non-zero exit status, that inetd will print to the syslog with something like:

inetd[15005]: /usr/libexec/telnetd[15008]: exited, status 1

If no maximum number of children is configured for a service, then this doesn't occur.

>How-To-Repeat:
Configure inetd.conf to have a finite maximum number of children for a service, and then execute and exit the service.
>Fix:
I looked at the source and found that se_maxchild is being checked in
addchild():

void
addchild(struct servtab *sep, pid_t pid)
{
       if (sep->se_maxchild <= 0)  <----
               return;
[...]
       sep->se_pids[sep->se_numchild++] = pid;
[...]

This is the only place that se_numchild gets incremented.  se_numchild
is used later on in logic in reapchild() to print out the above message.
If se_maxchild is 0 (never set in inetd.conf), then addchild() never
gets to increment se_numchild, and the logic in reapchild() is such that
the message never gets printed.

I think a simple change in reapchild() to not rely on se_maxchild when printing should solve this problem.
>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200408120109.i7C197OF046848>