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

Ed Schmed commented on ZOOKEEPER-1927:
--------------------------------------

both

-bash-3.2$ grep "^[ \t\r\n\v\f]*dataDir" 
/fuse/zookeeper-3.4.6/bin/../conf/zoo.cfg
dataDir=/fuse/zookeeper_data

and

-bash-3.2$ grep "^[ \s]*dataDir" /fuse/zookeeper-3.4.6/bin/../conf/zoo.cfg
dataDir=/fuse/zookeeper_data

work with the ancient built in solaris grep with no leading space, a single 
leading space, and many leading spaces.

However... neither work if their is a tab character inserted before the dataDir 
variable....

They are supposed to recognize tab from what i've read, but they are not 
working.

I will see if I can play around and find any thing else that does work, unless 
you have some other suggestions?

Thanks,
Ed


> zkServer.sh fails to read dataDir (and others) from zoo.cfg on Solaris 10 
> (grep issue, manifests as FAILED TO WRITE PID).  
> ---------------------------------------------------------------------------------------------------------------------------
>
>                 Key: ZOOKEEPER-1927
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1927
>             Project: ZooKeeper
>          Issue Type: Bug
>          Components: scripts
>    Affects Versions: 3.4.6
>         Environment: Solaris 5.10 
>            Reporter: Ed Schmed
>
> Fails to write PID file with a permissions error, because the startup script 
> fails to read the dataDir variable from zoo.cfg, and then tries to use the 
> drive root ( / ) as the data dir.
> Tracked the problem down to line 84 of zkServer.sh:
> ZOO_DATADIR="$(grep "^[[:space:]]*dataDir" "$ZOOCFG" | sed -e 's/.*=//')"
> If i run just that line and point it right at the config file, ZOO_DATADIR is 
> empty.
> If I remove [[:space:]]* from the grep:
> ZOO_DATADIR="$(grep "^dataDir" "$ZOOCFG" | sed -e 's/.*=//')"
> Then it works fine. (If I also make the same change on line 164 and 169)
> My regex skills are pretty bad, so I'm afraid to comment on why [[space]]* 
> needs to be in there?



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to