axkibe/lsyncd — Issue #89: lsyncd on arm system not finding getConfig()
Author: axkibe
Created: 2011-11-16 15:11:28+00:00
State: open

Originally filed by t00_m4d_f00@web.de on 2011-10-12T09:28:21

upon starting lsyncd I get the following error:

[admin@NASC123B8 csync2]# lsyncd -nodaemon -log all /opt/etc/lsyncd.conf
kernels clocks_per_sec=100
Call: configure()
Inotify: inotify fd = 3
Call: initialize()
11:26:42 Function: Inotify.addWatch(/share/MD0_DATA/exports/nginx/, (true), (nil), (nil))
11:26:42 Inotify: addwatch(/share/MD0_DATA/exports/nginx/)->1
11:26:42 Function: Inotify.addWatch(/share/MD0_DATA/exports/nginx/sites-available/, (true), (nil), (nil))
11:26:42 Inotify: addwatch(/share/MD0_DATA/exports/nginx/sites-available/)->2
11:26:42 Function: Inotify.addWatch(/share/MD0_DATA/exports/nginx/sites-enabled/, (true), (nil), (nil))
11:26:42 Inotify: addwatch(/share/MD0_DATA/exports/nginx/sites-enabled/)->3
11:26:42 Function: Inotify.addWatch(/share/MD0_DATA/exports/nginx/conf.d/, (true), (nil), (nil))
11:26:42 Inotify: addwatch(/share/MD0_DATA/exports/nginx/conf.d/)->4
11:26:42 Call: getAlarm()
11:26:42 Alarm: runner.getAlarm returns: (true)
11:26:42 Masterloop: immediately handling delays.
11:26:42 Call: cycle()
11:26:42 Function: invokeActions('Sync1',(Timestamp: 5273886.7))
11:26:42 Error: IN LUA: /opt/etc/lsyncd.conf:70: event does not have field 'getConfig'
11:26:42 Error: Backtrace 1 :[C]:-1
11:26:42 Error: Backtrace 2 :lsyncd.lua:737
11:26:42 Error: Backtrace 3 :/opt/etc/lsyncd.conf:70
11:26:42 Error: Backtrace 4 :lsyncd.lua:1475
11:26:42 Error: Backtrace 5 :lsyncd.lua:2597

[admin@NASC123B8 csync2]# lsyncd -version
Version: 2.0.5

[admin@NASC123B8 csync2]# lua -v
Lua 5.1.4 Copyright (C) 1994-2008 Lua.org, PUC-Rio

[admin@NASC123B8 csync2]# uname -a
Linux NASC123B8 2.6.33.2 #1 Fri May 20 07:16:37 CST 2011 armv5tel GNU/Linux

settings = {
logident = "lsyncd",
logfacility = "user",
logfile = "/opt/var/log/lsyncd/lsyncd.log",
statusFile = "/opt/var/log/lsyncd/status.log",
statusInterval = 1
}

initSync = {
delay = 1,
maxProcesses = 1,
action = function(inlet)
local config = inlet.getConfig()
local elist = inlet.getEvents(function(event)
return event.etype ~= "Blanket"
end)
local directory = string.sub(config.source, 1, -2)
local paths = elist.getPaths(function(etype, path)
return "\t" .. config.syncid .. ":" .. directory .. path
end)
log("Normal", "Processing syncing list:\n", table.concat(paths, "\n"))
spawn(elist, "/opt/usr/sbin/csync2", "-C", config.syncid, "-x")
end,
collect = function(agent, exitcode)
local config = agent.config
if not agent.isList and agent.etype == "Blanket" then
if exitcode == 0 then
log("Normal", "Startup of '", config.syncid, "' instance finished.")
elseif config.exitcodes and config.exitcodes[exitcode] == "again" then
log("Normal", "Retrying startup of '", config.syncid, "' instance.")
return "again"
else
log("Error", "Failure on startup of '", config.syncid, "' instance.")
terminate(-1)
end
return
end
local rc = config.exitcodes and config.exitcodes[exitcode]
if rc == "die" then
return rc
end
if agent.isList then
if rc == "again" then
log("Normal", "Retrying events list on exitcode = ", exitcode)
else
log("Normal", "Finished events list = ", exitcode)
end
else
if rc == "again" then
log("Normal", "Retrying ", agent.etype, " on ", agent.sourcePath, " = ", exitcode)
else
log("Normal", "Finished ", agent.etype, " on ", agent.sourcePath, " = ", exitcode)
end
end
return rc
end,
init = function(inlet)
local config = inlet.getConfig()
local event = inlet.createBlanketEvent()
log("Normal", "Recursive startup sync: ", config.syncid, ":", config.source)
spawn(event, "/opt/usr/sbin/csync2", "-C", config.syncid, "-x")
end,
prepare = function(config)
if not config.syncid then
error("Missing 'syncid' parameter.", 4)
end
local c = "csync2_" .. config.syncid .. ".cfg"
local f, err = io.open("/opt/etc/csync2/" .. c, "r")
if not f then
error("Invalid 'syncid' parameter: " .. err, 4)
end
f:close()
end
}

local sources = {
["/share/MD0_DATA/exports/nginx"] = "bps1and2"
}
for key, value in pairs(sources) do
sync {initSync, source=key, syncid=value}
end