IIRC, &#39;fork&#39; creates a child PID that stays around and waits for the parent PID to die. (Don&#39;t quote me on that - wait for an expert to chime in.) <div><br>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 &#39;exec&#39; cmd and then just keep the include cmd. </div>
<div><br></div><div>-MC<br><br><div class="gmail_quote">On Thu, Mar 10, 2011 at 2:19 AM, Mitja Thomas <span dir="ltr">&lt;<a href="mailto:mitja.thomas1@ewetel.de">mitja.thomas1@ewetel.de</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">


  

    
  
  <div bgcolor="#ffffff" text="#000000">
    Hi there,<br>
    <br>
    we tried to set up the FreeSWITCH and other Applications, so that we
    can configure them easier and more centralised.<br>
    Thus we defined some Environment Variables (using CentOS) which hold
    often used Configuration Parameter like MySQL IP or FS Event Socket
    IP.<br>
    We tried to integrate these Env Variables into the FS conf files by
    executing a shell Skript in freeswitch.xml via cmd=&quot;exec&quot; which
    prepares an conf file which we include into freeswitch.xml:<br>
    <br>
    <small><small>  &lt;X-PRE-PROCESS cmd=&quot;exec&quot; data=&quot;sh
        conf/make_my_vars.sh&quot;/&gt;<br>
          &lt;X-PRE-PROCESS cmd=&quot;include&quot; data=&quot;my_vars.xml&quot;/&gt;</small></small><br>
    <br>
    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. <br>
    <br>
    <small><small># ps -eaf | grep free<br>
        ippbx    22191 22190  4 09:41 pts/1    00:00:01
        /opt/app/voip/ippbx/bin/freeswitch -waste -nonat -hp<br>
        ippbx    22197 22191  0 09:41 pts/1    00:00:00 [freeswitch]
        &lt;defunct&gt;</small></small><br>
    <br>
    What I wanna know is: Is this a FS missbehaviour or do we use this
    in a wrong way?<br>
    <br>
    make_my_vars.sh:<br>
    <small><small>F=&quot;conf/my_vars.xml&quot;<br>
        echo &quot;&lt;!-- Auto generated file for getting *NIX evironment
        variables --&gt;&quot; &gt; $F<br>
        echo &quot;&lt;include&gt;&quot; &gt;&gt; $F<br>
        <br>
        fs_ip=`printenv MY_FS_IP`<br>
        if test -n &quot;$fs_ip&quot;<br>
        then<br>
                echo &#39;&lt;X-PRE-PROCESS cmd=&quot;set&quot;
        data=&quot;my_fs_ip=&#39;$fs_ip&#39;&quot;/&gt;&#39; &gt;&gt; $F<br>
        fi<br>
        ...<br>
        echo &quot;&lt;/include&gt;&quot; &gt;&gt; $F</small></small><br>
    <br>
    my_vars.xml (after FS startup):<br>
    <small><small>&lt;!-- Auto generated file for getting *NIX
        evironment variables --&gt;<br>
        &lt;include&gt;<br>
        &lt;X-PRE-PROCESS cmd=&quot;set&quot; data=&quot;my_fs_ip=***.***.***.***&quot;/&gt;<br>
        ...<br>
        &lt;/include&gt;</small></small><br>
    <br>
    Regards<br>
    Mitja<br>
  </div>

<br>_______________________________________________<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br></blockquote></div><br></div>