rlm_perl forking zombies

Alan DeKok aland at nitros9.org
Thu Jun 15 18:52:03 CEST 2006

david.suarezdelis at telefonica.es wrote:
> By itself, this works and no zombies are left behind, as expected. However,
> when used with FreeRadius, zombies are left behind.

  FreeRADIUS has a wrapper around fork() that modules are expected to
use.  The reason is that the server is threaded, and some modules want
to wait for the child to return.  In a threaded environment, the
SIGCHLD may be delivered to *another* thread, which causes problems.

  Hence the wrapper, which catches all of the SIGCHLD's, and ensures
they're delivered to the correct destination.

  In your case, you're not calling the wrapper, so it never waits for
that PID, and thus the zombie.

  A solution is to modify src/main/threads.c, function
reap_children().  Right now it loops over known PIDs, and waits on
them.  Change it to wait for any PID, and then look that PID up in the
list.  If it's known, it's updated.  Otherwise, the status is tossed.

  That should get rid of the zombies.

  If you can send a patch soon, it can make it into the next version
of the server.

  Alan DeKok.

More information about the Freeradius-Users mailing list