Author: tfonteyn
Date: 2013-07-08 09:37:31 -0400 (Mon, 08 Jul 2013)
New Revision: 3129
Modified:
trunk/utils/windows/native/service/examples/service.bat
Log:
[JBPAPP-10809] service.bat needs to work together with the new run.bat from JBPAPP-10804
Modified: trunk/utils/windows/native/service/examples/service.bat
===================================================================
--- trunk/utils/windows/native/service/examples/service.bat 2013-06-21 00:49:31 UTC (rev
3128)
+++ trunk/utils/windows/native/service/examples/service.bat 2013-07-08 13:37:31 UTC (rev
3129)
@@ -9,16 +9,13 @@
REM -------------------------------------------------------------------------
@if not "%ECHO%" == "" echo %ECHO%
-@if "%OS%" == "Windows_NT" setlocal
+@if "%OS%" == "Windows_NT" setlocal enableextensions
enabledelayedexpansion
set DIRNAME=%CD%
REM Read an optional configuration file located in the current (native/sbin) directory
-if "x%RUN_CONF%" == "x" (
- set "RUN_CONF=%DIRNAME%\run.conf.bat"
+if exist "%DIRNAME%\run.conf.bat" (
+ call "%DIRNAME%\run.conf.bat" %*
)
-if exist "%RUN_CONF%" (
- call "%RUN_CONF%" %*
-)
REM Modify these to set the profile to use and the bind address
set SVCPROFILE=default
@@ -108,21 +105,23 @@
echo %SVCPATH% > run.log
REM Read the JBoss configuration file which sets JAVA_OPTS. First try to find it in the
selected profile, otherwise use the global one
-REM note the different var names to get around cmd.exe limitations
-set JAVA_OPTS=
-set RUN_CONF=
-set "RUN_CONF_PROFILE=%SVCPATH%\..\server\%SVCPROFILE%\conf\run.conf.bat"
-set "RUN_CONF_BIN=%SVCPATH%\run.conf.bat"
-if exist "%RUN_CONF_PROFILE%" (
- call "%RUN_CONF_PROFILE%" %*
-) else (
- if exist "%RUN_CONF_BIN%" (
- call "%RUN_CONF_BIN%" %*
+if "x%RUN_CONF%" == "x" (
+ if exist "%SVCPATH%\..\server\%SVCPROFILE%\conf\run.conf.bat" (
+ set "RUN_CONF=%SVCPATH%\..\server\%SVCPROFILE%\conf\run.conf.bat"
+ ) else if exist "%SVCPATH%\..\server\%SVCPROFILE%\run.conf.bat" (
+ set "RUN_CONF=%SVCPATH%\..\server\%SVCPROFILE%\run.conf.bat"
) else (
- echo "No run.conf.bat found" >> run.log
+ set "RUN_CONF=%SVCPATH%\run.conf.bat"
)
)
+if exist "%RUN_CONF%" (
+ echo "Calling %RUN_CONF%"
+ call "%RUN_CONF%" %*
+) else (
+ echo "Config file not found %RUN_CONF%"
+)
+
REM Suppress killing service on logoff event
if "x%JAVA_OPTS%" == "x" (
set "JAVA_OPTS=-Xrs"
Show replies by date