I want to reload mod_lua in order to reload lua scripts that a starte automatically on start-up. But I get this: freeswitch@internal> reload mod_lua +OK Reloading XML -ERR unloading module [Module is not unloadable] -ERR loading module [Module already loaded] [CRIT] switch_loadable_module.c:1451 Module is not unloadable. [WARNING] switch_loadable_module.c:1400 Module mod_lua Already Loaded! [INFO] mod_enum.c:872 ENUM Reloaded [INFO] switch_time.c:1165 Timezone reloaded 530 definitions How to refresh modified lua scripts without reloading FS with restart? -- Mimiko desu.
Lua is not "unloadable" and therefore you cannot do this the way you are trying to. You'll need to restart FreeSWITCH. -MC On Mon, Jan 21, 2013 at 9:43 AM, Mimiko <vbvbrj@gmail.com> wrote:
I want to reload mod_lua in order to reload lua scripts that a starte automatically on start-up. But I get this:
freeswitch@internal> reload mod_lua +OK Reloading XML -ERR unloading module [Module is not unloadable] -ERR loading module [Module already loaded]
[CRIT] switch_loadable_module.c:1451 Module is not unloadable. [WARNING] switch_loadable_module.c:1400 Module mod_lua Already Loaded! [INFO] mod_enum.c:872 ENUM Reloaded [INFO] switch_time.c:1165 Timezone reloaded 530 definitions
How to refresh modified lua scripts without reloading FS with restart? -- Mimiko desu.
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.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
-- Michael S Collins Twitter: @mercutioviz http://www.FreeSWITCH.org http://www.ClueCon.com http://www.OSTAG.org
or you can have your script listen for event or check a variable and exit the script as needed. and another background script which will start the script again if it's not running. not a simple solution but doable. On 1/21/2013 1:52 PM, Michael Collins wrote:
Lua is not "unloadable" and therefore you cannot do this the way you are trying to. You'll need to restart FreeSWITCH. -MC
On Mon, Jan 21, 2013 at 9:43 AM, Mimiko <vbvbrj@gmail.com <mailto:vbvbrj@gmail.com>> wrote:
I want to reload mod_lua in order to reload lua scripts that a starte automatically on start-up. But I get this:
freeswitch@internal> reload mod_lua +OK Reloading XML -ERR unloading module [Module is not unloadable] -ERR loading module [Module already loaded]
[CRIT] switch_loadable_module.c:1451 Module is not unloadable. [WARNING] switch_loadable_module.c:1400 Module mod_lua Already Loaded! [INFO] mod_enum.c:872 ENUM Reloaded [INFO] switch_time.c:1165 Timezone reloaded 530 definitions
How to refresh modified lua scripts without reloading FS with restart? -- Mimiko desu.
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org <mailto:consulting@freeswitch.org> http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org 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 UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
-- Michael S Collins Twitter: @mercutioviz http://www.FreeSWITCH.org http://www.ClueCon.com http://www.OSTAG.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.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
A tool that can monitor Lua threads, and kill them, would come in useful every so often... -Avi On Mon, Jan 21, 2013 at 11:14 PM, Abaci <abaci64@gmail.com> wrote:
or you can have your script listen for event or check a variable and exit the script as needed. and another background script which will start the script again if it's not running. not a simple solution but doable.
On 1/21/2013 1:52 PM, Michael Collins wrote:
Lua is not "unloadable" and therefore you cannot do this the way you are trying to. You'll need to restart FreeSWITCH. -MC
On Mon, Jan 21, 2013 at 9:43 AM, Mimiko <vbvbrj@gmail.com> wrote:
I want to reload mod_lua in order to reload lua scripts that a starte automatically on start-up. But I get this:
freeswitch@internal> reload mod_lua +OK Reloading XML -ERR unloading module [Module is not unloadable] -ERR loading module [Module already loaded]
[CRIT] switch_loadable_module.c:1451 Module is not unloadable. [WARNING] switch_loadable_module.c:1400 Module mod_lua Already Loaded! [INFO] mod_enum.c:872 ENUM Reloaded [INFO] switch_time.c:1165 Timezone reloaded 530 definitions
How to refresh modified lua scripts without reloading FS with restart? -- Mimiko desu.
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.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
-- Michael S Collins Twitter: @mercutioviz http://www.FreeSWITCH.org <http://www.freeswitch.org/> http://www.ClueCon.com <http://www.cluecon.com/> http://www.OSTAG.org <http://www.ostag.org/>
_________________________________________________________________________ Professional FreeSWITCH Consulting Services:consulting@freeswitch.orghttp://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Serverhttp://www.cudatel.com
Official FreeSWITCH Siteshttp://www.freeswitch.orghttp://wiki.freeswitch.orghttp://www.cluecon.com
FreeSWITCH-users mailing listFreeSWITCH-users@lists.freeswitch.orghttp://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-usershttp://www.frees...
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.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
Interesting. A mod_lua api that would list the currently running lua scripts with an id that could be used to kill off individual scripts. William King Senior Engineer Quentus Technologies, INC 1037 NE 65th St Suite 273 Seattle, WA 98115 Main: (877) 211-9337 Office: (206) 388-4772 Cell: (253) 686-5518 william.king@quentustech.com On 01/21/2013 01:21 PM, Avi Marcus wrote:
A tool that can monitor Lua threads, and kill them, would come in useful every so often...
-Avi
On Mon, Jan 21, 2013 at 11:14 PM, Abaci <abaci64@gmail.com <mailto:abaci64@gmail.com>> wrote:
or you can have your script listen for event or check a variable and exit the script as needed. and another background script which will start the script again if it's not running. not a simple solution but doable.
On 1/21/2013 1:52 PM, Michael Collins wrote:
Lua is not "unloadable" and therefore you cannot do this the way you are trying to. You'll need to restart FreeSWITCH. -MC
On Mon, Jan 21, 2013 at 9:43 AM, Mimiko <vbvbrj@gmail.com <mailto:vbvbrj@gmail.com>> wrote:
I want to reload mod_lua in order to reload lua scripts that a starte automatically on start-up. But I get this:
freeswitch@internal> reload mod_lua +OK Reloading XML -ERR unloading module [Module is not unloadable] -ERR loading module [Module already loaded]
[CRIT] switch_loadable_module.c:1451 Module is not unloadable. [WARNING] switch_loadable_module.c:1400 Module mod_lua Already Loaded! [INFO] mod_enum.c:872 ENUM Reloaded [INFO] switch_time.c:1165 Timezone reloaded 530 definitions
How to refresh modified lua scripts without reloading FS with restart? -- Mimiko desu.
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org <mailto:consulting@freeswitch.org> http://www.freeswitchsolutions.com <http://www.freeswitchsolutions.com/>
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com <http://www.cudatel.com/>
Official FreeSWITCH Sites http://www.freeswitch.org <http://www.freeswitch.org/> http://wiki.freeswitch.org <http://wiki.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 UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org <http://www.freeswitch.org/>
-- Michael S Collins Twitter: @mercutioviz http://www.FreeSWITCH.org <http://www.freeswitch.org/> http://www.ClueCon.com <http://www.cluecon.com/> http://www.OSTAG.org <http://www.ostag.org/>
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org <mailto:consulting@freeswitch.org> http://www.freeswitchsolutions.com <http://www.freeswitchsolutions.com/>
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com <http://www.cudatel.com/>
Official FreeSWITCH Sites http://www.freeswitch.org <http://www.freeswitch.org/> http://wiki.freeswitch.org <http://wiki.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 UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org <http://www.freeswitch.org/>
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org <mailto:consulting@freeswitch.org> http://www.freeswitchsolutions.com <http://www.freeswitchsolutions.com/>
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com <http://www.cudatel.com/>
Official FreeSWITCH Sites http://www.freeswitch.org <http://www.freeswitch.org/> http://wiki.freeswitch.org <http://wiki.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 UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org <http://www.freeswitch.org/>
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.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
On 21.01.2013 23:47, William King wrote:
Interesting. A mod_lua api that would list the currently running lua scripts with an id that could be used to kill off individual scripts.
Lua scripts, started with FS on start-up must not be killed, but updated when changing code of script. A killing command for a lua script is ok for scripts that got in loop/. -- Mimiko desu.
mod_lua was reloadable but when I found that long-running scripts cannot be easily stopped the developers changed it to un-reloadable. I'd find some way to start/stop long-running scripts and I'd seen some implementations based on my example: http://fisheye.freeswitch.org/browse/freeswitch-contrib.git/seven/lua/gatewa... There's also a blog page in Chinese explaining this: http://www.freeswitch.org.cn/2010/03/15/zai-freeswitchzhong-zhi-xing-chang-q... Hope this helps. On Tuesday, January 22, 2013 at 3:40 PM, Mimiko wrote:
On 21.01.2013 23:47, William King wrote:
Interesting. A mod_lua api that would list the currently running lua scripts with an id that could be used to kill off individual scripts.
Lua scripts, started with FS on start-up must not be killed, but updated when changing code of script. A killing command for a lua script is ok for scripts that got in loop/.
-- Mimiko desu.
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org (mailto:consulting@freeswitch.org) http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org 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 UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
The reason being if the module unloads while scripts are still running you're going to be almost guaranteed a segmentation fault - a well meaning admin running a simple command could crash the entire server dropping all calls. -Steve On 22 January 2013 15:53, Seven Du <dujinfang@gmail.com> wrote:
mod_lua was reloadable but when I found that long-running scripts cannot be easily stopped the developers changed it to un-reloadable.
I'd find some way to start/stop long-running scripts and I'd seen some implementations based on my example:
http://fisheye.freeswitch.org/browse/freeswitch-contrib.git/seven/lua/gatewa...
There's also a blog page in Chinese explaining this: http://www.freeswitch.org.cn/2010/03/15/zai-freeswitchzhong-zhi-xing-chang-q...
Hope this helps.
On Tuesday, January 22, 2013 at 3:40 PM, Mimiko wrote:
On 21.01.2013 23:47, William King wrote:
Interesting. A mod_lua api that would list the currently running lua scripts with an id that could be used to kill off individual scripts.
Lua scripts, started with FS on start-up must not be killed, but updated when changing code of script. A killing command for a lua script is ok for scripts that got in loop/.
-- Mimiko desu.
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.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
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.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
Rather than waiting forever using - pop(1) -, you can set a timeout value: pop(1, 500). This allows you to let the lua script do some bookkeeping: check for a hash value, file existence, sql select etc. and the script can decide to end itself, without having to wait for a (specific) event. Additionally, this will allow lua to do some bookkeeping. If you use a lua script that runs forever while listening for events, the script may eat your memory, as lua might never get a chance to do proper garbage collection. Make sure you do not subscribe to all events in your lua script, processing events in lua takes time, just subscribe to the events you need. On 22 January 2013 15:53, Seven Du <dujinfang@gmail.com> wrote: mod_lua was reloadable but when I found that long-running scripts cannot be easily stopped the developers changed it to un-reloadable. I'd find some way to start/stop long-running scripts and I'd seen some implementations based on my example: http://fisheye.freeswitch.org/browse/freeswitch-contrib.git/seven/lua/gatewa y_report.lua?hb=true There's also a blog page in Chinese explaining this: http://www.freeswitch.org.cn/2010/03/15/zai-freeswitchzhong-zhi-xing-chang-q i-yun-xing-de-qian-ru-shi-jiao-ben-luayu-yan-li-zi.html Hope this helps. On Tuesday, January 22, 2013 at 3:40 PM, Mimiko wrote: On 21.01.2013 23:47, William King wrote: Interesting. A mod_lua api that would list the currently running lua scripts with an id that could be used to kill off individual scripts. Lua scripts, started with FS on start-up must not be killed, but updated when changing code of script. A killing command for a lua script is ok for scripts that got in loop/. -- Mimiko desu. _________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.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 _________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.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
On 21.01.2013 20:52, Michael Collins wrote:
Lua is not "unloadable" and therefore you cannot do this the way you are trying to. You'll need to restart FreeSWITCH. -MC
Oh, it's not so good. Update lua scripts that a started within dialplan execution is updating automatically, but scripts which start with FS automatically is not convenient to update only restarting FS. May be there is some method to update lua scripts without restarting FS? -- Mimiko desu.
participants (8)
-
Abaci
-
Avi Marcus
-
grmt
-
Michael Collins
-
Mimiko
-
Seven Du
-
Steven Ayre
-
William King