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

Daniel Barclay (Drill) commented on DRILL-2446:
-----------------------------------------------

Re:
    touch $DRILL_LOG_DIR/sqlline.log
That should be quoted:
    touch "$DRILL_LOG_DIR/sqlline.log"


Re
    if [[ "x${DRILL_LOG_DIR}" == "x" ]]; then
and
    if ... [[ "$DRILL_LOG_DIR_FALLBACK" == "1" ]]; then
That should work, but might be confusing:  In "[[ ... ]]", the "==" operator is 
not equality comparison but "glob" pattern matching (in general--however, since 
the right argument ('"x"') is quoted, the pattern matching would use exact 
matching even for characters such as asterisk ("*") which would be special if 
not quoted there).

The single-bracket form should be sufficient since the argument are properly 
quoted (see "test" in the "SHELL BUILTIN COMMANDS" section of the Bash manual 
page).  Also the Bash manual page recommends "=" rather than "==":
    if [ "${DRILL_LOG_DIR}" == " ]; then


> Checking for log file location failed after upgrade
> ---------------------------------------------------
>
>                 Key: DRILL-2446
>                 URL: https://issues.apache.org/jira/browse/DRILL-2446
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Tools, Build & Test
>    Affects Versions: 0.8.0
>            Reporter: Krystal
>            Assignee: Daniel Barclay (Drill)
>             Fix For: 0.8.0
>
>         Attachments: DRILL-2446.1.patch.txt, drill-config.sh
>
>
> git.commit.id=710656a1949e249dc7ad326dccc7c632f563495c
> Upgraded to drill 0.8 from a previous 0.8 version. Ran the following 
> connection string to invoke sqlline:
> [root@qa-node57 ~]# bin/sqlline --maxWidth=10000 -n admin -p admin -u 
> jdbc:drill:schema=dfs.root;zk=10.10.100.56:5181
> /opt/mapr/drill/drill-0.8.0/bin/drill-config.sh: line 94: [: =: unary 
> operator expected
> sqlline version 1.1.6
> From /opt/mapr/drill/drill-0.8.0/bin/drill-config.sh, line 94 is:
> if [ ! -d $DRILL_LOG_DIR ] || [ $DRILL_LOG_DIR_FALLBACK = 1 ]; then
> echo "Drill log directory $DRILL_LOG_DIR does not exist or is not writable, 
> defaulting to $DRILL_HOME/log"
> DRILL_LOG_DIR=$DRILL_HOME/log
> mkdir -p $DRILL_LOG_DIR
> fi
> I don't have "/var/log/drill" directory



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to