Small bug in using file_auto_define. I am using files_auto_define to detect
if cf-served has been updated and restart if so:


files_auto_define => { "/opt/cfengine/bin/.*" };

...

  processes:

    "$(cf3_processes)"
         signals => { "kill" },
         ifvarclass => canonify("auto__opt_cfengine_bin_$(cf3_processes)");

    "$(cf3_processes)"
          restart_class => canonify("start_$(cf3_processes)");


  commands:

      "/opt/cfengine/bin/$(cf3_processes)"
          ifvarclass => canonify("start_$(cf3_processes)");

      "/opt/cfengine/bin/$(cf3_processes)"
          ifvarclass => canonify("auto__opt_cfengine_bin_$(cf3_processes)");

}


This works pretty slick, but why do I need to added the extra test using the
auto class?

      "/opt/cfengine/bin/$(cf3_processes)"
          ifvarclass => canonify("auto__opt_cfengine_bin_$(cf3_processes)");

Does cfengine do a snapshot of the process table, so when I kill cf-serverd,
it doesn't know that it is died when it parses the restart_class on the next
stanza? Either way, the extra lines don't hurt. But that is not the bug for
which I am posting.


>From verbose logging:


cf3  !! Image file /opt/cfengine/bin/cf-serverd out of date (should be copy
of XXXXXXX)
cf3  -> Updated /opt/cfengine/bin/cf-serverd from source XXXXXXXXXX
cf3 auto__opt_cfengine_bin_cf_serverd
cf3 (Auto defining class %s
<<<<<--- weird formatting error
: Error 0)
cf3  -> Copy of regular file succeeded XXXX/cf-serverd.cfnew
cf3 Object /opt/cfengine/bin/cf-serverd had permission 600, changed it to
755

I traced it back to MakeReport, but didn't dig deep enough to find the
actual problem as it is a minor reporting bug and doesn't effect the
operation of cfengine. Below is the debugger output up to where is croaks:


MakeReport(mess = 0x202d5f08, prefix = 1), line 274 in "cfstream.c"
CfOut(level = cf_inform, errstr = "Auto defining class %s\n", fmt =
"auto__opt_cfengine_bin_cf_serverd", ... = 0x0, 0x6400, 0x72766572,
0x808080, 0x7f7f7f7f), line 44 in "cfstream.c"
FileAutoDefine(destfile = "/opt/cfengine/bin/cf-serverd"), line 1731 in
"files_interfaces.c"
unnamed block $b47, line 839 in "files_interfaces.c"
CopyFile(sourcefile = "XXXXX/cf-serverd", destfile =
"/opt/cfengine/bin/cf-serverd", ssb = (...), attr = (...), pp = 0x202d2ea8),
line 839 in "files_interfaces.c"
VerifyCopy(source = "XXXXX/cf-serverd", destination =
"/opt/cfengine/bin/cf-serverd", attr = (...), pp = 0x202d2ea8), line 459 in
"files_interfaces.c"
SourceSearchAndCopy(from = "/cfengine3/group_1/aix/aix_5.2", to =
"/opt/cfengine/bin", maxrecurse = 999999999, attr = (...), pp = 0x202d2ea8),
line 168 in "files_interfaces.c"
CopyFileSources(destination = "/opt/cfengine/bin", attr = (...), pp =
0x202d2ea8), line 79 in "files_copy.c"
ScheduleCopyOperation(destination = "/opt/cfengine/bin", attr = (...), pp =
0x202d2ea8), line 190 in "files_operators.c"
VerifyFilePromise(path = "/opt/cfengine/bin", pp = 0x202d2ea8), line 314 in
"files_interfaces.c"
FindFilePromiserObjects(pp = 0x202d2ea8), line 61 in "verify_files.c"
FindAndVerifyFilesPromises(pp = 0x202d2ea8), line 37 in "verify_files.c"
KeepAgentPromise(pp = 0x202d2ea8), line 814 in "agent.c"
ExpandPromiseAndDo(agent = cf_agent, scopeid = "update", pp = 0x202898f8,
scalarvars = 0x202d27d8, listvars = (nil), fnptr = 0x2014b3f8), line 593 in
"expand.c"
ExpandPromise(agent = cf_agent, scopeid = "update", pp = 0x202511d8, fnptr =
0x2014b3f8), line 115 in "expand.c"
ScheduleAgentOperations(bp = 0x2024b9a8), line 670 in "agent.c"
KeepPromiseBundles(), line 634 in "agent.c"
KeepPromises(), line 273 in "agent.c"
main(argc = 2, argv = 0x2ff229a0), line 131 in "agent.c"
_______________________________________________
Bug-cfengine mailing list
[email protected]
https://cfengine.org/mailman/listinfo/bug-cfengine

Reply via email to