bin/70335: inconsistent syslog behavior when max children configured in inetd.conf

David S. Wang dsw at juniper.net
Wed Aug 11 18:10:18 PDT 2004


>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 at 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:


More information about the freebsd-bugs mailing list