This commit is contained in:
parent
dc513e1efa
commit
e9b2c207f9
@ -9,17 +9,16 @@ local group = "haproxy"
|
|||||||
local libs = {"-ljansson", "-lmaxminddb", "-lcurl"}
|
local libs = {"-ljansson", "-lmaxminddb", "-lcurl"}
|
||||||
|
|
||||||
function compile.check(module)
|
function compile.check(module)
|
||||||
local sourcepath = modpath.."/"..module..".c"
|
local sourcepath = string.format("%s/%s.c", modpath, module)
|
||||||
local binpath = modpath.."/"..module..".so"
|
local binpath = string.format("%s/%s.so", modpath, module)
|
||||||
|
|
||||||
local binexists = io.open(binpath)
|
local binexists = io.open(binpath)
|
||||||
|
|
||||||
if not binexists or (binexists and lfs.attributes(sourcepath).change > lfs.attributes(binpath).change ) then
|
if not binexists or (binexists and lfs.attributes(sourcepath).change > lfs.attributes(binpath).change ) then
|
||||||
local cmd = "cc -I/usr/include/ -I/usr/include/lua" .. lua_version .. "/ -fPIC -shared -o " .. binpath .. " " .. sourcepath .. " " ..table.concat(libs," ")
|
local cmd = string.format("cc -I/usr/include/ -I/usr/include/lua%s/ -fPIC -shared -o %s %s %s", lua_version, binpath, sourcepath, table.concat(libs," "))
|
||||||
local res = io.popen(cmd)
|
local res = io.popen(cmd)
|
||||||
local aa = res:read("a*")
|
io.popen("chown %s:%s %s", user, group, binpath)
|
||||||
io.popen("chown "..user..":"..group.." "..binpath)
|
io.popen(string.format("chmod 600 %s",binpath))
|
||||||
io.popen("chmod 600 "..binpath)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ function create_state()
|
|||||||
lastconns = core.get_info()["CumConns"]
|
lastconns = core.get_info()["CumConns"]
|
||||||
|
|
||||||
if try == 10 then
|
if try == 10 then
|
||||||
local msg = "Worker with pid ".. core.get_info()["Pid"] .. " exited for create_state task"
|
local msg = string.format("Worker with pid %s exited for create_state task",core.get_info()["Pid"])
|
||||||
print(msg)
|
print(msg)
|
||||||
core.done(msg)
|
core.done(msg)
|
||||||
end
|
end
|
||||||
|
@ -58,7 +58,7 @@ function arrange_backends()
|
|||||||
lastconns = core.get_info()["CumConns"]
|
lastconns = core.get_info()["CumConns"]
|
||||||
|
|
||||||
if try == 10 then
|
if try == 10 then
|
||||||
local msg = "Worker with pid ".. core.get_info()["Pid"] .. " exited for arrange_backends task"
|
local msg = string.format("Worker with pid %s exited for arrange_backends task", core.get_info()["Pid"])
|
||||||
print(msg)
|
print(msg)
|
||||||
core.done(msg)
|
core.done(msg)
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user