OK, but can I move windows scripts to bin directory, same as unix scripts? 
It's somewhat important because referencing base dir depends upon the
location of the script files, and also, its expected dir, and maintaining
the scripts would be much better than since it would be obvious one need to
change both versions (at least try to do so).

-Vjeran

-----Original Message-----
From: Jun Rao [mailto:jun...@gmail.com] 
Sent: Saturday, January 25, 2014 5:28 PM
To: users@kafka.apache.org
Subject: Re: Shell scripts for Windows corrected

Could you submit a patch to fix the windows script in trunk?

Thanks,

Jun


On Sat, Jan 25, 2014 at 1:18 AM, Vjeran Marcinko <
vjeran.marci...@email.t-com.hr> wrote:

> Hi,
>
>
>
> Is there some reason that shell scripts for Windows are separated into 
> its own dir instead being placed in <kafka_dir>/bin with other Unix ones?
>
>
>
> Most of products out there have both types of scripts in bin dir.
>
>
>
> One mroe thing, windows scripts need some corrections to be able to 
> call them from anywhere - they need to resolve kafka base dir (0or bin 
> dir) by resolving the dir where scripts reside (naturally "bin" 
> directory), by using "%~dp0" for eg in "kafka-list-topics.bat" (which 
> doesn't exist at all in windows dir):
>
>
>
> @echo off
>
> if not defined KAFKA_BIN_PATH (
>
>   set KAFKA_BIN_PATH=%~dp0
>
> )
>
> if "%KAFKA_BIN_PATH:~-1%" == "\" (
>
>   set KAFKA_BIN_PATH=%KAFKA_BIN_PATH:~0,-1%
>
> )
>
> %KAFKA_BIN_PATH%\kafka-run-class.bat kafka.admin.ListTopicCommand %*
>
>
>
> Similarly, in kafka-run-class.bat there should be snippet for 
> resolving base dir via similar fashion:
>
>
>
> if not defined KAFKA_BIN_PATH (
>
>   set KAFKA_BIN_PATH=%~dp0
>
> )
>
> if "%KAFKA_BIN_PATH:~-1%" == "\" (
>
>   set KAFKA_BIN_PATH=%KAFKA_BIN_PATH:~0,-1%
>
> )
>
> set BASE_DIR=%KAFKA_BIN_PATH%\..
>
>
>
> Moreover, windows version doesn't have log4j properties separated for 
> starting zookeeper/kafka and those for executing tool tasks, so like 
> Unix versions, there should be something like:
>
>
>
> IF ["%KAFKA_LOG4J_OPTS%"] EQU [""] (
>
>             set
>
> KAFKA_LOG4J_OPTS=-Dlog4j.configuration=file:"%BASE_DIR%/config/tools-l
> og4j.p
> roperties"
>
> )
>
> IF ["%KAFKA_OPTS%"] EQU [""] (
>
>             set KAFKA_OPTS=-Xmx512M -server
>
> )
>
>
>
> .and then somewhere later to include it in execution call.
>
> set COMMAND= %JAVA% %KAFKA_OPTS% %KAFKA_LOG4J_OPTS% %KAFKA_JMX_OPTS% 
> -cp %CLASSPATH% %*
>
>
>
> Zookeeper and Kafka startup scripts should override log4j tool 
> settings by having for eg.:
>
>
>
> @echo off
>
> if not defined KAFKA_BIN_PATH (
>
>   set KAFKA_BIN_PATH=%~dp0
>
> )
>
> if "%KAFKA_BIN_PATH:~-1%" == "\" (
>
>   set KAFKA_BIN_PATH=%KAFKA_BIN_PATH:~0,-1%
>
> )
>
> set
>
> KAFKA_LOG4J_OPTS=-Dlog4j.configuration=file:"%KAFKA_BIN_PATH%\..\confi
> g\log4
> j.properties"
>
> %KAFKA_BIN_PATH%\kafka-run-class.bat
> org.apache.zookeeper.server.quorum.QuorumPeerMain %*
>
>
>
> -Vjeran
>
>

Reply via email to