[Freeswitch-users] [freeswitch] <defunct> when using cmd="exec" in freeswitch.xml
Mitja Thomas
mitja.thomas1 at ewetel.de
Wed Apr 20 11:17:52 MSD 2011
Yepp thanks,
I saw that they fixed because someelse posted a similiar question and
Anthony told him there was a fix for it. I tried it and it works fine.
BTW: Sorry that I didnt opened a bug report on jira, but I wasnt sure at
the time if it was a bug or just a misuse on my part.
Regards
Mitja
> The child process needs to be "reaped" in order to get out of
> <defunct> and of course it'll be cleared out when the parent process
> finally exits.
>
> <looking at code>
>
> I don't see any reason why it would leave a zombie. The code
> correctly calls waitpid() after the fork in the parent code.
>
> Oh, looks like brian added waitpid on :
>
> dae2cb4a (Brian West 2011-03-29 18:05:05 -0500 1246)
>
> So update and it should work.
>
> On Tue, Mar 15, 2011 at 3:36 AM, Mitja Thomas<mitja.thomas1 at ewetel.de> wrote:
>> Hi Micheal,
>>
>> yeah I think your workaround will work fine and Ill change it that way. But
>> this issue might still be a missbehaviour. Either by fs in which case I
>> think it might be an interesting information for the Developers OR a wrong
>> usage by me in which case this is an interesting information for me :)
>>
>> Thanks,
>> Mitja
>>
>> IIRC, 'fork' creates a child PID that stays around and waits for the parent
>> PID to die. (Don't quote me on that - wait for an expert to chime in.)
>> An alternative method would be to have a FS start script that launches your
>> make_my_vars.sh script and then launches FS with the appropriate cmd line
>> args. You could then drop the 'exec' cmd and then just keep the include
>> cmd.
>> -MC
>>
>> On Thu, Mar 10, 2011 at 2:19 AM, Mitja Thomas<mitja.thomas1 at ewetel.de>
>> wrote:
>>> Hi there,
>>>
>>> we tried to set up the FreeSWITCH and other Applications, so that we can
>>> configure them easier and more centralised.
>>> Thus we defined some Environment Variables (using CentOS) which hold often
>>> used Configuration Parameter like MySQL IP or FS Event Socket IP.
>>> We tried to integrate these Env Variables into the FS conf files by
>>> executing a shell Skript in freeswitch.xml via cmd=xec" which prepares an
>>> conf file which we include into freeswitch.xml:
>>>
>>> <X-PRE-PROCESS cmd=xec" data="sh conf/make_my_vars.sh"/>
>>> <X-PRE-PROCESS cmd=nclude" data="my_vars.xml"/>
>>>
>>> This works as expected and the pre defined variables in my_vars can be
>>> accessed from the other config Files, except that when we start our
>>> FreeSWITCH a zombie child process is spawned.
>>>
>>> # ps -eaf | grep free
>>> ippbx 22191 22190 4 09:41 pts/1 00:00:01
>>> /opt/app/voip/ippbx/bin/freeswitch -waste -nonat -hp
>>> ippbx 22197 22191 0 09:41 pts/1 00:00:00 [freeswitch]<defunct>
>>>
>>> What I wanna know is: Is this a FS missbehaviour or do we use this in a
>>> wrong way?
>>>
>>> make_my_vars.sh:
>>> F=onf/my_vars.xml"
>>> echo "<!-- Auto generated file for getting *NIX evironment variables -->"
>>>> $F
>>> echo "<include>">> $F
>>>
>>> fs_ip=rintenv MY_FS_IP`
>>> if test -n "$fs_ip"
>>> then
>>> echo '<X-PRE-PROCESS cmd=et" data="my_fs_ip='$fs_ip'"/>'>> $F
>>> fi
>>> ...
>>> echo "</include>">> $F
>>>
>>> my_vars.xml (after FS startup):
>>> <!-- Auto generated file for getting *NIX evironment variables -->
>>> <include>
>>> <X-PRE-PROCESS cmd=et" data="my_fs_ip=***.***.***.***"/>
>>> ...
>>> </include>
>>>
>>> Regards
>>> Mitja
>>>
>>> _______________________________________________
>>> FreeSWITCH-users mailing list
>>> FreeSWITCH-users at lists.freeswitch.org
>>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>>> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
>>> http://www.freeswitch.org
>>>
>>
>>
>> _______________________________________________
>> FreeSWITCH-users mailing list
>> FreeSWITCH-users at lists.freeswitch.org
>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
>> http://www.freeswitch.org
>>
>>
>
>
--
Mitja Thomas
GE FD
Lösungsmanagement
Telefon: 0441 8000 - 4916
E-Mail: mitja.thomas at ewe.de
___________________________________
EWE TEL GmbH
Cloppenburger Straße 310
26133 Oldenburg
Handelsregister Amtsgericht Oldenburg HRB 3723
Vorsitzender des Aufsichtsrates: Dr. Werner Brinker
Geschäftsführung: Konrad Meier (Vorsitzender), Dirk Brameier,
Ulf Heggenberger, Norbert Westfal
Homepage: http://www.ewetel.de
Wir stehen für starken Service. Versprochen!
More information about the FreeSWITCH-users
mailing list