[ 
https://issues.apache.org/jira/browse/FLUME-1303?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13398377#comment-13398377
 ] 

Will McQueen commented on FLUME-1303:
-------------------------------------

Fixed by replacing:

     ^java\.library\.path=([^\n])

...with:

     ^java\.library\.path=(.*)$


Tested with test script:

#!/bin/bash

TEST_STR=$(echo -e "prevline\\njava.library.path=nxnyn\\nnextline")
echo "original:|$TEST_STR|"

    IFS=$'\n'
    for line in $TEST_STR; do
      echo "candidate:|$line|"
      if [[ $line =~ ^java\.library\.path=(.*)$ ]]; then
        echo FOUND
        TEST_OUTPUT=${BASH_REMATCH[1]}
        break
      fi
    done
    unset IFS

echo "Result is: |$TEST_OUTPUT|"


Output of test script is as follows (and is correct):

original:|prevline
java.library.path=nxnyn
nextline|
candidate:|prevline|
candidate:|java.library.path=nxnyn|
FOUND
Result is: |nxnyn|


Also tested by running flume-ng with hadoop and hbase libs installed and with 
hbase-env.sh containing the following uncommented line:
     export HBASE_OPTS="$HBASE_OPTS -verbose:class -XX:+PrintGCDetails 
-XX:+PrintGCDateStamps"

The output for java.library.path was as expected:
     
-Djava.library.path=:/usr/lib/hadoop/lib/native:/usr/lib/hadoop/lib/native:/usr/lib/hbase/bin/../lib/native/Linux-amd64-64

                
> java.library.path value is being truncated at first 'n' char
> ------------------------------------------------------------
>
>                 Key: FLUME-1303
>                 URL: https://issues.apache.org/jira/browse/FLUME-1303
>             Project: Flume
>          Issue Type: Bug
>          Components: Shell
>    Affects Versions: v1.2.0
>         Environment: RHEL 6.2 64-bit
>            Reporter: Will McQueen
>            Assignee: Will McQueen
>            Priority: Blocker
>             Fix For: v1.2.0
>
>
> In the flume-ng script, the '\' and 'n' characters are each being treated as 
> delimiters instead of being treated as a newline character. This relates to 
> the following line of code that is found in 2 places within the script:
>      if [[ $line =~ ^java\.library\.path=([^\n]*) ]]; then
>  This causes the java.library.path's value to be truncated at the first '\' 
> or \n' character in its value.
> For example:
> [will@will-laptop flume-1.2.0-incubating-SNAPSHOT]$ bin/flume-ng agent -d
> ...results in a java.library.path of:
>      -Djava.library.path=:/usr/lib/hadoop/lib/:/
> ..but should be:
>      
> -Djava.library.path=:/usr/lib/hadoop/lib/native:/usr/lib/hadoop/lib/native:/usr/lib/hbase/bin/../lib/native/Linux-amd64-64

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to