This is an automated email from the ASF dual-hosted git repository.
markt pushed a commit to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/8.5.x by this push:
new c493589 Fix BZ 64645 Use non-zero exit code if script fails
c493589 is described below
commit c4935893c34c2a80517e0592cda745ef7fdf983e
Author: Mark Thomas <[email protected]>
AuthorDate: Wed Aug 12 16:12:04 2020 +0100
Fix BZ 64645 Use non-zero exit code if script fails
https://bz.apache.org/bugzilla/show_bug.cgi?id=64645
---
bin/service.bat | 17 ++++++++---------
webapps/docs/changelog.xml | 4 ++++
2 files changed, 12 insertions(+), 9 deletions(-)
diff --git a/bin/service.bat b/bin/service.bat
index d9188ec..b170e64 100755
--- a/bin/service.bat
+++ b/bin/service.bat
@@ -67,7 +67,7 @@ if "x%1x" == "xx" goto displayUsage
set SERVICE_USER=%1
shift
runas /env /savecred /user:%SERVICE_USER% "%COMSPEC% /K \"%SELF%\"
%SERVICE_CMD% %SERVICE_NAME%"
-goto end
+exit /b 0
rem Check the environment
:checkEnv
@@ -98,7 +98,7 @@ echo Either the CATALINA_HOME environment variable is not
defined correctly or
echo the incorrect service name has been used.
echo Both the CATALINA_HOME environment variable and the correct service name
echo are required to run this program.
-goto end
+exit /b 1
:okHome
cd "%CURRENT_DIR%"
@@ -127,7 +127,7 @@ goto okJavaHome
echo The JAVA_HOME environment variable is not defined correctly
echo This environment variable is needed to run this program
echo NB: JAVA_HOME should point to a JDK not a JRE
-goto end
+exit /b 1
:okJavaHome
if not "%CATALINA_BASE%" == "" goto gotBase
set "CATALINA_BASE=%CATALINA_HOME%"
@@ -154,7 +154,7 @@ echo Unknown parameter "%SERVICE_CMD%"
:displayUsage
echo.
echo Usage: service.bat install/remove [service_name [--rename]] [--user
username]
-goto end
+exit /b 1
:doRemove
rem Remove the service
@@ -165,14 +165,14 @@ echo Using CATALINA_BASE: "%CATALINA_BASE%"
--LogPath "%CATALINA_BASE%\logs"
if not errorlevel 1 goto removed
echo Failed removing '%SERVICE_NAME%' service
-goto end
+exit /b 1
:removed
echo The service '%SERVICE_NAME%' has been removed
if exist "%CATALINA_HOME%\bin\%SERVICE_NAME%.exe" (
rename "%SERVICE_NAME%.exe" "%DEFAULT_SERVICE_NAME%.exe"
rename "%SERVICE_NAME%w.exe" "%DEFAULT_SERVICE_NAME%w.exe"
)
-goto end
+exit /b 0
:doInstall
rem Install the service
@@ -232,8 +232,7 @@ if exist "%CATALINA_HOME%\bin\%DEFAULT_SERVICE_NAME%.exe" (
--JvmMx "%JvmMx%"
if not errorlevel 1 goto installed
echo Failed installing '%SERVICE_NAME%' service
-goto end
+exit /b 1
:installed
echo The service '%SERVICE_NAME%' has been installed.
-
-:end
+exit /b 0
\ No newline at end of file
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 83581c4..db9d5a0 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -125,6 +125,10 @@
Improve the quality of the Japanese translations provided with Apache
Tomcat. Includes contributions from Yuki Shira. (markt)
</add>
+ <fix>
+ <bug>64645</bug>: Use a non-zero exit code if the
+ <code>service.bat</code> does not complete normally. (markt)
+ </fix>
</changelog>
</subsection>
</section>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]