defunct processes created by bgsystem / system
I have the following action in my dialplan: <action application="bgsystem" data = "/opt/scripts/push_handler.php ${uuid} ${sip_contact_user} ${host}"/> each time that command gets executed I see another defunct freeswitch process created: root@cor03-san:/usr/local/freeswitch/log# ps -ef | grep freeswitch root 23010 1 2 06:37 ? 00:00:25 /usr/local/freeswitch/bin/freeswitch -nc -nonat root 23209 23010 0 06:44 ? 00:00:00 [freeswitch] <defunct> root 23242 23010 0 06:45 ? 00:00:00 [freeswitch] <defunct> root 23300 23010 0 06:48 ? 00:00:00 [freeswitch] <defunct> I tried changing 'bgsystem' to 'system' and reloaded the dialplan, but it continued to drop defunct processes. I’ve entered Jira FS-10572 as it seems like this is a bug, but I am wondering if there is a workaround of some kind?
I think you need to call "bgsystem" data = "*php */opt/scripts/push_handler.php ${uuid} ${sip_contact_user} ${host}"/> and pake sure tha PHP executable is in your path. On Wed, Aug 9, 2017 at 2:45 PM, Dave Horton <daveh@beachdognet.com> wrote:
I have the following action in my dialplan:
<action application="bgsystem" data = "/opt/scripts/push_handler.php ${uuid} ${sip_contact_user} ${host}"/>
each time that command gets executed I see another defunct freeswitch process created:
root@cor03-san:/usr/local/freeswitch/log# ps -ef | grep freeswitch root 23010 1 2 06:37 ? 00:00:25 /usr/local/freeswitch/bin/freeswitch -nc -nonat root 23209 23010 0 06:44 ? 00:00:00 [freeswitch] <defunct> root 23242 23010 0 06:45 ? 00:00:00 [freeswitch] <defunct> root 23300 23010 0 06:48 ? 00:00:00 [freeswitch] <defunct>
I tried changing 'bgsystem' to 'system' and reloaded the dialplan, but it continued to drop defunct processes.
I’ve entered Jira FS-10572 as it seems like this is a bug, but I am wondering if there is a workaround of some kind? _________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com
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
-- Guillermo Ruiz Camauer
Well, the script actually does execute, so I don’t think that is the issue. On Aug 9, 2017, at 5:06 PM, Guillermo Ruiz Camauer <grcamauer@gmail.com> wrote: I think you need to call "bgsystem" data = "php /opt/scripts/push_handler.php ${uuid} ${sip_contact_user} ${host}"/> and pake sure tha PHP executable is in your path. On Wed, Aug 9, 2017 at 2:45 PM, Dave Horton <daveh@beachdognet.com <mailto:daveh@beachdognet.com>> wrote: I have the following action in my dialplan: <action application="bgsystem" data = "/opt/scripts/push_handler.php ${uuid} ${sip_contact_user} ${host}"/> each time that command gets executed I see another defunct freeswitch process created: root@cor03-san:/usr/local/freeswitch/log# ps -ef | grep freeswitch root 23010 1 2 06:37 ? 00:00:25 /usr/local/freeswitch/bin/freeswitch -nc -nonat root 23209 23010 0 06:44 ? 00:00:00 [freeswitch] <defunct> root 23242 23010 0 06:45 ? 00:00:00 [freeswitch] <defunct> root 23300 23010 0 06:48 ? 00:00:00 [freeswitch] <defunct> I tried changing 'bgsystem' to 'system' and reloaded the dialplan, but it continued to drop defunct processes. I’ve entered Jira FS-10572 as it seems like this is a bug, but I am wondering if there is a workaround of some kind? _________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org <mailto:consulting@freeswitch.org> http://www.freeswitchsolutions.com <http://www.freeswitchsolutions.com/> Official FreeSWITCH Sites http://www.freeswitch.org <http://www.freeswitch.org/> http://confluence.freeswitch.org <http://confluence.freeswitch.org/> http://www.cluecon.com <http://www.cluecon.com/> FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org <mailto:FreeSWITCH-users@lists.freeswitch.org> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users <http://lists.freeswitch.org/mailman/listinfo/freeswitch-users> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users <http://lists.freeswitch.org/mailman/options/freeswitch-users> http://www.freeswitch.org <http://www.freeswitch.org/> -- Guillermo Ruiz Camauer _________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com 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
After more testing, it looks like I was wrong about being able to recreate this when using the 'system' api. It does happen when using the 'bgsystem' api, but from looking at the source code that basically appears to be by design. A workaround that is satisfactory for my purposes was to enable 'threaded-system-exec' (in switch.conf.xml) which makes freeswitch run these commands in a new thread rather than forking/execing a new process. Particularly for the use of 'bgsystem', this is more desirable since it negates the issue of defunct processes, and there is no parallel concerns with threads. I have closed the associated JIRA.
participants (2)
-
Dave Horton
-
Guillermo Ruiz Camauer