[
https://issues.apache.org/jira/browse/TS-1555?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13528849#comment-13528849
]
Luca Rea commented on TS-1555:
------------------------------
Of course...
Example n.1:
Plugin.config:
{noformat}
# Comments start with a '#' and continue to the end of the line
# Blank lines are ignored
#
# test-plugin.so arg1 arg2 arg3
#
# Example:
#inktomi/iwx/iwx.so
#inktomi/abuse/abuse.so etc/trafficserver/abuse.config
#inktomi/icx/icx.so etc/trafficserver/icx.config
#/usr/local/libexec/trafficserver/lua.so
/usr/local/libexec/trafficserver/hooks.lua
lua.so /usr/local/libexec/trafficserver/hooks.lua
{noformat}
Result:
{noformat}
[TrafficServer] using root directory '/usr/local'
[Dec 11 10:46:38.187] Server {0x7fe8e7d56840} DIAG: (lua) LuaApiInit:
initializing TS API
[Dec 11 10:46:38.187] Server {0x7fe8e7d56840} DIAG: (lua) LuaHookApiInit:
initializing TS Hook API
[Dec 11 10:46:38.187] Server {0x7fe8e7d56840} DIAG: (hooks) loaded
@/usr/local/libexec/trafficserver/hooks.lua
[Dec 11 10:46:38.187] Server {0x7fe8e7d56840} DIAG: (lua)
TSLuaHttpHookRegister: [1]=number [2]=function
[Dec 11 10:46:38.187] Server {0x7fe8e7d56840} DIAG: (lua)
TSLuaHttpHookRegister: registering hook HTTP_SSN_START_HOOK (11)
[Dec 11 10:46:38.187] Server {0x7fe8e7d56840} DIAG: (lua)
TSLuaHttpHookRegister: installed continuation for HTTP_SSN_START_HOOK
[Dec 11 10:46:38.187] Server {0x7fe8e7d56840} DIAG: (lua)
TSLuaHttpHookRegister: [1]=number [2]=function
[Dec 11 10:46:38.188] Server {0x7fe8e7d56840} DIAG: (lua)
TSLuaHttpHookRegister: registering hook HTTP_TXN_START_HOOK (9)
[Dec 11 10:46:38.188] Server {0x7fe8e7d56840} DIAG: (lua)
TSLuaHttpHookRegister: installed continuation for HTTP_TXN_START_HOOK
^CNOTE: Traffic Server received Sig 2: Interrupt
[root@w0w trafficserver]#
{noformat}
Example n.2:
Plugin.config:
{noformat}
# Comments start with a '#' and continue to the end of the line
# Blank lines are ignored
#
# test-plugin.so arg1 arg2 arg3
#
# Example:
#inktomi/iwx/iwx.so
#inktomi/abuse/abuse.so etc/trafficserver/abuse.config
#inktomi/icx/icx.so etc/trafficserver/icx.config
/usr/local/libexec/trafficserver/lua.so
/usr/local/libexec/trafficserver/hooks.lua
#lua.so /usr/local/libexec/trafficserver/hooks.lua
{noformat}
Result:
{noformat}
[root@w0w trafficserver]# /usr/local/bin/traffic_server
[TrafficServer] using root directory '/usr/local'
^CNOTE: Traffic Server received Sig 2: Interrupt
[root@w0w trafficserver]#
{noformat}
In the second example the Lua plugin seems not working correctly.
> Lua Plugin doesn't work
> -----------------------
>
> Key: TS-1555
> URL: https://issues.apache.org/jira/browse/TS-1555
> Project: Traffic Server
> Issue Type: Bug
> Environment: Fedora 17
> Reporter: Luca Rea
> Fix For: 3.3.3
>
>
> To compile correctly lua support I needed to create the following symbolic
> link:
> cd /usr/lib64
> ln -s liblua-5.1.so liblua5.1.so
> After that I've tried to use "hooks.lua" in plugin.config but ATS returns the
> following error:
> "failed to load Lua file /usr/local/libexec/trafficserver/lua.so:
> /usr/local/libexec/trafficserver/lua.so:1: unexpected symbol near 'char(127)'
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira