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
>Synopsis: inconsistent syslog behavior when max children configured in inetd.conf
>Arrival-Date: Thu Aug 12 01:10:17 GMT 2004
>Originator: David S. Wang
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
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: /usr/libexec/telnetd: exited, status 1
If no maximum number of children is configured for a service, then this doesn't occur.
Configure inetd.conf to have a finite maximum number of children for a service, and then execute and exit the service.
I looked at the source and found that se_maxchild is being checked in
addchild(struct servtab *sep, pid_t pid)
if (sep->se_maxchild <= 0) <----
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.
More information about the freebsd-bugs