You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zookeeper.apache.org by "Raul Gutierrez Segales (JIRA)" <ji...@apache.org> on 2016/09/08 03:57:20 UTC

[jira] [Commented] (ZOOKEEPER-1927) zkServer.sh fails to read dataDir (and others) from zoo.cfg on Solaris 10 (grep issue, manifests as FAILED TO WRITE PID).

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

Raul Gutierrez Segales commented on ZOOKEEPER-1927:
---------------------------------------------------

Oops -- forgot to merge for 3.5 (literally a year ago!):

https://github.com/apache/zookeeper/commit/ac26b96b61e116937239a15fb4dbcc4f17a4f818

(thanks [~phunt] for the heads-up) 


> 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
>            Assignee: Chris Nauroth
>             Fix For: 3.4.7, 3.5.2, 3.6.0
>
>         Attachments: ZOOKEEPER-1927-branch-3.4.002.patch, ZOOKEEPER-1927.001.patch, ZOOKEEPER-1927.002.patch
>
>
> 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.3.4#6332)