[Freeswitch-users] [freeswitch] <defunct> when using cmd="exec" in freeswitch.xml
Rupa Schomaker
rupa at rupa.com
Wed Apr 20 00:09:21 MSD 2011
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="exec" which prepares an
>> conf file which we include into freeswitch.xml:
>>
>> <X-PRE-PROCESS cmd="exec" data="sh conf/make_my_vars.sh"/>
>> <X-PRE-PROCESS cmd="include" 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="conf/my_vars.xml"
>> echo "<!-- Auto generated file for getting *NIX evironment variables -->"
>> > $F
>> echo "<include>" >> $F
>>
>> fs_ip=`printenv MY_FS_IP`
>> if test -n "$fs_ip"
>> then
>> echo '<X-PRE-PROCESS cmd="set" 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="set" 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
>
>
--
-Rupa
More information about the FreeSWITCH-users
mailing list