views:

64

answers:

1

I have a problem with cruisecontrol where an ant scripts executes a bat file that doesn't give me the prompt back. As a result, the project in cruisecontrol keeps on bulding forever until I restart cruisecontrol. How can I resolve this?

It's a startup.bat from wowza (Streaming Server) that I'm executing:

@echo off

call setenv.bat

if not %WMSENVOK% == "true" goto end

set _WINDOWNAME="Wowza Media Server 2"
set _EXESERVER=
if "%1"=="newwindow" (
set _EXESERVER=start %_WINDOWNAME%
shift
)

set CLASSPATH="%WMSAPP_HOME%\bin\wms-bootstrap.jar"

rem cacls jmxremote.password /P username:R
rem cacls jmxremote.access /P username:R

rem NOTE: Here you can configure the JVM's built in JMX interface.
rem See the "Server Management Console and Monitoring" chapter
rem of the "User's Guide" for more information on how to configure the
rem remote JMX interface in the [install-dir]/conf/Server.xml file.

set JMXOPTIONS=-Dcom.sun.management.jmxremote=true
rem set JMXOPTIONS=%JMXOPTIONS% 
    -Djava.rmi.server.hostname=192.168.1.7
rem set JMXOPTIONS=%JMXOPTIONS% 
    -Dcom.sun.management.jmxremote.port=1099
rem set JMXOPTIONS=%JMXOPTIONS% 
    -Dcom.sun.management.jmxremote.authenticate=false
rem set JMXOPTIONS=%JMXOPTIONS% 
    -Dcom.sun.management.jmxremote.ssl=false
rem set JMXOPTIONS=%JMXOPTIONS% 
    -Dcom.sun.management.jmxremote.password.file=
       "%WMSCONFIG_HOME%/conf/jmxremote.password"
rem set JMXOPTIONS=%JMXOPTIONS% -Dcom.sun.management.jmxremote.access.file=
       "%WMSCONFIG_HOME%/conf/jmxremote.access"

rem log interceptor com.wowza.wms.logging.LogNotify 
    - see Javadocs for ILogNotify

%_EXESERVER% "%_EXECJAVA%" %JAVA_OPTS% %JMXOPTIONS% 
-Dcom.wowza.wms.AppHome="%WMSAPP_HOME%" 
-Dcom.wowza.wms.ConfigURL="%WMSCONFIG_URL%" 
-Dcom.wowza.wms.ConfigHome="%WMSCONFIG_HOME%" 
-cp %CLASSPATH% com.wowza.wms.bootstrap.Bootstrap start

:end
+1  A: 

From a first look it seems that adding a start command to the line where the server is started might help, i.e.:

start "" %_EXESERVER% "%_EXECJAVA%" %JAVA_OPTS% %JMXOPTIONS% 
-Dcom.wowza.wms.AppHome="%WMSAPP_HOME%" 
-Dcom.wowza.wms.ConfigURL="%WMSCONFIG_URL%" 
-Dcom.wowza.wms.ConfigHome="%WMSCONFIG_HOME%" 
-cp %CLASSPATH% com.wowza.wms.bootstrap.Bootstrap start
0xA3
If I do that, a new cmd popup opens where the Wowza Server is started, but in the original cmd window, the prompt isn't given back... (thx)
Lieven Cardoen
How do you start `startup.bat`? If this is from another bat file you should call it with `call startup.bat` or using the cmd.exe command with the /C option.
0xA3
It is done using ant with:<target name="startwowza"> <exec executable="cmd" dir="${wowza.dir}/bin"> <arg value="/c"/> <arg value="startup.bat"/> <arg value="-p"/> </exec></target>
Lieven Cardoen
Actually, the /C is known to me, but not the -p... Got it from the ant docs. So, even with /C, an extra cmd window is opened which doesn't close automatically at the end, and apparently the parent cmd window waits until the child cmd window returns the prompt.
Lieven Cardoen
When adding the start "", shouldn't there also be a /C option?
Lieven Cardoen
@Lieven Cardoen: Well, I also have no more clues right now... `start` doesn't have a `/C` option (you can get all options with `start /?`), and I also don't see the purpose of the `-p` option. Will the command return if you call `cmd.exe /C startup.bat -p` manually from the command prompt? You can also replace `@echo off` with `@echo on` to see where exactly startup.bat stops.
0xA3