Uploaded image for project: 'Chukwa'
  1. Chukwa
  2. CHUKWA-104

Chukwa data collection depends on the permission of the log file

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Data Collection
    • Labels:
      None
    • Environment:

      Redhat 5.1, Java 6

      Description

      In ChukwaDailyRollingAppender, the appender should set the file permission to be readable by ChukwaAgent. In this release, we are setting it to 644 to be sure that the log file can be collected by ChukwaAgent.

      1. CHUKWA-104.patch
        0.8 kB
        Eric Yang
      2. CHUKWA-104-2.patch
        2 kB
        Jerome Boulon

        Issue Links

          Activity

          Hide
          eyang Eric Yang added a comment -

          Manually set umask to 644.

          Show
          eyang Eric Yang added a comment - Manually set umask to 644.
          Hide
          eyang Eric Yang added a comment -

          Patch for enable 644 permission for Chukwa Agent

          Show
          eyang Eric Yang added a comment - Patch for enable 644 permission for Chukwa Agent
          Hide
          jboulon Jerome Boulon added a comment - - edited

          -1 forcing 644 is not the right way to do it

          here what I think about setting permission in Chukwa Appender:

          • use log4j to set permission to the log file, ex: log4j.appender.CHUKWA.readPermission=
            • readPermission field not present in log4j, don't do anything, file permission will use the default
            • readPermission field set to "All" then setReadable(true, false) otherwise setReadable(true, true)
            • writePermission field not present in log4j, don't do anything, file permission will use the default
            • writePermission field set to "All" then setWritable(true, false) otherwise setReadable(true, true)

          Also, using Java API will make our code portable

          Show
          jboulon Jerome Boulon added a comment - - edited -1 forcing 644 is not the right way to do it here what I think about setting permission in Chukwa Appender: use log4j to set permission to the log file, ex: log4j.appender.CHUKWA.readPermission= readPermission field not present in log4j, don't do anything, file permission will use the default readPermission field set to "All" then setReadable(true, false) otherwise setReadable(true, true) writePermission field not present in log4j, don't do anything, file permission will use the default writePermission field set to "All" then setWritable(true, false) otherwise setReadable(true, true) Also, using Java API will make our code portable
          Hide
          eyang Eric Yang added a comment -

          Cancel patch until proper fix can be implemented in place. Reassign to Jerome to resolve this issue.

          Show
          eyang Eric Yang added a comment - Cancel patch until proper fix can be implemented in place. Reassign to Jerome to resolve this issue.
          Hide
          eyang Eric Yang added a comment -

          Jerome, I think we should remove chmod code completely from Chukwa Appender. What do you think?

          Show
          eyang Eric Yang added a comment - Jerome, I think we should remove chmod code completely from Chukwa Appender. What do you think?
          Hide
          jboulon Jerome Boulon added a comment -

          +1 on removing all chmod from the log4jAppender but we also need to remove the permission in Log4jMetricsContext to be consistent.
          I'll open a separate Jira to track log4j permission

          Show
          jboulon Jerome Boulon added a comment - +1 on removing all chmod from the log4jAppender but we also need to remove the permission in Log4jMetricsContext to be consistent. I'll open a separate Jira to track log4j permission
          Hide
          jboulon Jerome Boulon added a comment -

          Remove all permission changes.

          Show
          jboulon Jerome Boulon added a comment - Remove all permission changes.
          Hide
          eyang Eric Yang added a comment -

          The patch does not apply, it is not the same as the svn code.

          Show
          eyang Eric Yang added a comment - The patch does not apply, it is not the same as the svn code.
          Hide
          jboulon Jerome Boulon added a comment -

          My patch CHUKWA-104-2.patch, it's from the same svn code and could be applied to trunk but not to the 0.1 branch.
          The reason is that the first version of the 104 Jira: CHUKWA-104.patch ( 2009-04-07 09:27 PM ) has been applied to trunk and not to the branch.

          This has been done at the same time of CHUKWA-26 even if CHUKWA-26 didn't change the "chmod", see http://svn.apache.org/viewvc?view=rev&revision=763513 for details.

          Either apply CHUKWA-104.patch to the 0.1 branch or revert CHUKWA-104.patch from trunk and I will recreate my patch.

          Show
          jboulon Jerome Boulon added a comment - My patch CHUKWA-104 -2.patch, it's from the same svn code and could be applied to trunk but not to the 0.1 branch. The reason is that the first version of the 104 Jira: CHUKWA-104 .patch ( 2009-04-07 09:27 PM ) has been applied to trunk and not to the branch. This has been done at the same time of CHUKWA-26 even if CHUKWA-26 didn't change the "chmod", see http://svn.apache.org/viewvc?view=rev&revision=763513 for details. Either apply CHUKWA-104 .patch to the 0.1 branch or revert CHUKWA-104 .patch from trunk and I will recreate my patch.
          Hide
          eyang Eric Yang added a comment -

          I just committed this, thanks Jerome.

          Show
          eyang Eric Yang added a comment - I just committed this, thanks Jerome.
          Hide
          hudson Hudson added a comment -
          Show
          hudson Hudson added a comment - Integrated in Chukwa-trunk #8 (See http://hudson.zones.apache.org/hudson/job/Chukwa-trunk/8/ )
          Hide
          hudson Hudson added a comment -
          Show
          hudson Hudson added a comment - Integrated in Chukwa-trunk #45 (See http://hudson.zones.apache.org/hudson/job/Chukwa-trunk/45/ )

            People

            • Assignee:
              jboulon Jerome Boulon
              Reporter:
              eyang Eric Yang
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development