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

Fernando commented on ZOOKEEPER-477:
------------------------------------

Here is the diff/patch to apply. Yes I give all gives to Apache.

--- /export/home/fern/servers/zookeeper-3.2.0/bin/zkCleanup.sh  2009-07-01 
09:51:22.000000000 -0700
+++ puppet-mnt/etc/modules/zookeeper320/files/zkCleanup.sh      2009-07-17 
12:01:08.000000000 -0700
@@ -36,8 +36,16 @@
 
 . $ZOOBINDIR/zkEnv.sh
 
-eval `grep -e "^dataDir=" $ZOOCFG`
+ZOODATADIR=$(grep '^dataDir=' $ZOOCFG | sed -e 's/.*=//')
+ZOODATALOGDIR=$(grep '^dataLogDir=' $ZOOCFG | sed -e 's/.*=//')
 
+if [ "x${ZOODATALOGDIR}" = "x" ]
+then
 java "-Dzookeeper.log.dir=${ZOO_LOG_DIR}" 
"-Dzookeeper.root.logger=${ZOO_LOG4J_PROP}" \
      -cp $CLASSPATH $JVMFLAGS \
-     org.apache.zookeeper.server.PurgeTxnLog $dataDir
+     org.apache.zookeeper.server.PurgeTxnLog $ZOODATADIR $*
+else
+java "-Dzookeeper.log.dir=${ZOO_LOG_DIR}" 
"-Dzookeeper.root.logger=${ZOO_LOG4J_PROP}" \
+     -cp $CLASSPATH $JVMFLAGS \
+     org.apache.zookeeper.server.PurgeTxnLog $ZOODATALOGDIR $ZOODATADIR $*
+fi


> zkCleanup.sh is flaky
> ---------------------
>
>                 Key: ZOOKEEPER-477
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-477
>             Project: Zookeeper
>          Issue Type: Bug
>          Components: scripts
>    Affects Versions: 3.2.0
>            Reporter: Fernando
>
> the zkCleanup.sh script is buggy in two ways:
> 1) it doesn't actually pass through the snapshot count, so it doesn't work
> 2) it assumes that there is only dataDir, it doesn't support dataLogDir
> And it can use cleanup, so that it doesn't blindly call eval from the config 
> file..

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to