updated haproxy state
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Paul 2024-05-25 13:54:44 +02:00
parent dc513e1efa
commit e9b2c207f9
3 changed files with 7 additions and 8 deletions

View File

@ -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

View File

@ -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

View File

@ -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