[oi-dev] bring rrdtool to oi-userland

Alexander Pyhalov alp at rsu.ru
Mon Aug 26 21:56:38 UTC 2013


Please, review https://github.com/pyhalov/oi-userland/compare/rrdtool

This is a rrdtool with lua 5.2 support. lua 5.2 patch is taken from 
Ubuntu and slightly corrected.
One correction which actually worries me:

line 18 of components/rrdtool/patches/rrdtool-1.4.7-lua-5.2.patch which 
sets LUA_LFLAGS="" and prevents lua module to be linked with liblua.so.
Without this hack simple lua programs like

local rrd = require "rrd"
local first, last = rrd.first("test.rrd"), rrd.last("test.rrd")
local start, step, names, data =
rrd.fetch("test.rrd", "--start", first, "--end", last, "MAX")
io.write(string.format("Start:       %s (%d)\n",
os.date("%c", start),start))
io.write("Step size:   ", step, " seconds\n")
io.write("DS names:    ", table.concat(names, ', '), "\n")
io.write("Data points: ", #data[1], "\n")
io.write("Data:\n")
for i,dp in ipairs(data) do
io.write(os.date("%t", start), " (", start, "): ")
start = start + step
for j,v in ipairs(dp) do
io.write(v, " ")
end
io.write("\n")
end

fail with
lua: multiple Lua VMs detected
stack traceback:
[C]: in ?
[C]: in function 'require'
1.lua:6: in main chunk
[C]: in ?

I don't know if it is a perculiarity of lua interpreter (perhaps in 
fully embedded lua program this is necessary...).

-- 
System Administrator of Southern Federal University Computer Center




More information about the oi-dev mailing list