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?