On Thu, Jun 15, 2006 at 05:42:45PM +0200, [EMAIL PROTECTED] said: > Greetings, > > I have FreeRadius 1.1.0 working on Debian 3.1 on an Intel box. > > When using rlm_perl, the authenticate() sub does its job and, eventually, > calls a method to send an email to a certain address before returning OK. > > The problem is that this SMTP connection can take longer than wished, > therefore I am forking the SMTP call, so the authentication process can go > on as normal. > > The problem with this solution, though, is that--as I cannot wait for the > SMTP connection to be done--the process is left as a zombie. I have, > therefore, used a double forking solution, where the grandfather returns > inmediately to the authorize() function, and the child forks again, and > waits (waitpid()) for the new (grand)child to do the job, so no zombie is > created. > > By itself, this works and no zombies are left behind, as expected. However, > when used with FreeRadius, zombies are left behind. I have tried to > 'IGNORE' SIGCHLD, to use reaper function (and all the other tricks in > perlipc(1)) to no avail (I am even using Proc::Fork to simplify things so I > am sure I am doing things properly). > > Is this a problem with my calling this inside the authenticate() function, > or with rlm_perl, or...? Is this a problem with 1.1.0 and solved with a > later version?
I can't tell you without seeing the script, but the way I would handle this (if I understand correctly) would be two fold. First, set up a signal handler for SIGCHLD that is a callback to a subroutine that calls waitpid(). Then, at the end of your script, if you haven't received SIGCHLD, and you're about to exit, jump to the routine that handles SIGCHLD. Then go back to just using a single fork. You could presumably track whether you're even supposed to have a child out there with a variable, so as to skip the jump at the end if you've already reaped your child process. My advice herre may be wrong, of course - I do not use rlm_perl, but I do use perl fairly regularly. -- -------------------------------------------------------------------------- | Stephen Gran | God is dead and I don't feel all too | | [EMAIL PROTECTED] | well either.... -- Ralph Moonen | | http://www.lobefin.net/~steve | | --------------------------------------------------------------------------
signature.asc
Description: Digital signature
- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html