Uploaded image for project: 'CFEngine Community'
  1. CFEngine Community
  2. CFE-85

log_* actions create duplicate entries

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Medium
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Built-in functions
    • Labels:
      None

      Description

      Consider this:

      <pre>
      body common control
      {
      bundlesequence =>

      { "test" }

      ;
      inputs =>

      { "cfengine_stdlib.cf" }

      ;
      }

      bundle agent test
      {
      vars:

      "software" slist =>

      { "/tmp/123", "/tmp/xyz" }

      ;

      files:

      "$(software)"

      create => "true",
      perms => m("644"),
      action => logme("$(software)");

      }

      body action logme
      {
      log_kept => "/tmp/private_keptlog.log";
      log_failed => "/tmp/private_faillog.log";
      log_repaired => "/tmp/private_replog.log";
      log_string => "$(sys.date) $ promise status";
      }
      </pre>

      Now we run it with cf-agent -I

      <pre>
      -> Created file /tmp/123, mode = 420
      -> Created file /tmp/xyz, mode = 420

      $ date
      Thu Sep 13 14:24:56 EDT 2012

      $ ls -l /tmp/123
      rw-rr- 1 newatson cad 0 Sep 13 14:24 /tmp/123
      $ ls -l /tmp/xyz
      rw-rr- 1 newatson cad 0 Sep 13 14:24 /tmp/xyz

      $ ls -l /tmp/private_*
      rw-rw-rw 1 newatson cad 294 Sep 13 14:24 /tmp/private_keptlog.log
      rw-rw-rw 1 newatson cad 98 Sep 13 14:24 /tmp/private_replog.log
      $ cat /tmp/private_keptlog.log
      Thu Sep 13 14:24:38 2012 /tmp/123 promise status
      Thu Sep 13 14:24:38 2012 /tmp/123 promise status
      Thu Sep 13 14:24:38 2012 /tmp/123 promise status
      Thu Sep 13 14:24:38 2012 /tmp/xyz promise status
      Thu Sep 13 14:24:38 2012 /tmp/xyz promise status
      Thu Sep 13 14:24:38 2012 /tmp/xyz promise status
      $ cat /tmp/private_replog.log
      Thu Sep 13 14:24:38 2012 /tmp/123 promise status
      Thu Sep 13 14:24:38 2012 /tmp/xyz promise status
      </pre>

      How did eight log entries come from this? Ideally I should see just one for each promiser. At worst I might expect to see two, one for create and one for chmod for each promiser.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              neilhwatson Neil Watson
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:

                Summary Panel