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@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@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org