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

Missing progname in syslog messages

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Done
    • Priority: (None)
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.10.0, 3.9.2, 3.7.5
    • Component/s: None
    • Labels:
      None
    • Platform:
      Ubuntu

      Description

      At least with cfengine-3.7.2, in the syslog messages generated by cf-execd, the program name is missing, only the pid is set.
      The generated logs are therefore difficult to filter correctly, extract:

      Dec  8 15:09:57 myserver [31857]: CFEngine(executor)  There is no readable input file at '/home/loic/tmp/cfe372/var/cfengine/inputs/promises.cf'. (stat: No such file or directory)
      Dec  8 15:09:57 myserver [31857]: CFEngine(executor)  Failsafe condition triggered. Interactive session detected, skipping failsafe.cf execution.
      Dec  8 15:09:57 myserver [31857]: CFEngine(executor)  Error reading CFEngine policy. Exiting...
      
      

      Expected:

      Dec  8 15:09:57 myserver cf-execd[31857]: CFEngine(executor)  There is no readable input file at '/home/loic/tmp/cfe372/var/cfengine/inputs/promises.cf'. (stat: No such file or directory)
      Dec  8 15:09:57 myserver cf-execd[31857]: CFEngine(executor)  Failsafe condition triggered. Interactive session detected, skipping failsafe.cf execution.
      Dec  8 15:09:57 myserver cf-execd[31857]: CFEngine(executor)  Error reading CFEngine policy. Exiting...
      
      

      The attached patch takes care to check if VPREFIX == "" in OpenLog().
      If so, openlog() is called with NULL as first parameter, so argv[0] is used as the program name.
      Otherwise, VPREFIX is used.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                a10038 jimis (Dimitrios Apostolou)
                Reporter:
                loic06 Loic Pefferkorn
              • Votes:
                2 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Summary Panel