<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=ISO-8859-15">
  </head>
  <body 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="exec" which
    prepares an conf file which we include into freeswitch.xml:<br>
    <br>
    <small><small>  &lt;X-PRE-PROCESS cmd="exec" data="sh
        conf/make_my_vars.sh"/&gt;<br>
          &lt;X-PRE-PROCESS cmd="include" data="my_vars.xml"/&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="conf/my_vars.xml"<br>
        echo "&lt;!-- Auto generated file for getting *NIX evironment
        variables --&gt;" &gt; $F<br>
        echo "&lt;include&gt;" &gt;&gt; $F<br>
        <br>
        fs_ip=`printenv MY_FS_IP`<br>
        if test -n "$fs_ip"<br>
        then<br>
                echo '&lt;X-PRE-PROCESS cmd="set"
        data="my_fs_ip='$fs_ip'"/&gt;' &gt;&gt; $F<br>
        fi<br>
        ...<br>
        echo "&lt;/include&gt;" &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="set" data="my_fs_ip=***.***.***.***"/&gt;<br>
        ...<br>
        &lt;/include&gt;</small></small><br>
    <br>
    Regards<br>
    Mitja<br>
  </body>
</html>