summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorDaniil Fedotov <dfedotov@pivotal.io>2017-08-08 15:28:20 +0100
committerDaniil Fedotov <dfedotov@pivotal.io>2017-08-08 15:28:20 +0100
commit514ae583081db55228a3a433a25b81167255e897 (patch)
treeeb8c5ef9b69fb58b089f04fa18c86f42d0a86364 /scripts
parent2a01b6c6d18c2f29abbfa5fbf88d5de1ac9c43c3 (diff)
downloadrabbitmq-server-git-514ae583081db55228a3a433a25b81167255e897.tar.gz
Start/stop windows service using `net` utility instead of `erlsrv`
`erlsrv` doc suggests to use windows system control tools to control services. It prints weird error when error is occured (for example access is denied), so using `net` is prefered.
Diffstat (limited to 'scripts')
-rw-r--r--scripts/rabbitmq-service.bat16
1 files changed, 14 insertions, 2 deletions
diff --git a/scripts/rabbitmq-service.bat b/scripts/rabbitmq-service.bat
index ab88120b74..47f1755800 100644
--- a/scripts/rabbitmq-service.bat
+++ b/scripts/rabbitmq-service.bat
@@ -76,7 +76,8 @@ if not exist "!ERLANG_SERVICE_MANAGER_PATH!\erlsrv.exe" (
)
if "!P1!" == "install" goto INSTALL_SERVICE
-for %%i in (start stop disable enable list remove) do if "%%i" == "!P1!" goto MODIFY_SERVICE
+for %%i in (start stop) do if "%%i" == "!P1!" goto START_STOP_SERVICE
+for %%i in (disable enable list remove) do if "%%i" == "!P1!" goto MODIFY_SERVICE
echo.
echo *********************
@@ -226,16 +227,27 @@ set ERLANG_SERVICE_ARGUMENTS=!ERLANG_SERVICE_ARGUMENTS:"=\"!
if ERRORLEVEL 1 (
EXIT /B 1
)
-
goto END
:MODIFY_SERVICE
"!ERLANG_SERVICE_MANAGER_PATH!\erlsrv" !P1! !RABBITMQ_SERVICENAME!
+if ERRORLEVEL 1 (
+ EXIT /B 1
+)
goto END
+:START_STOP_SERVICE
+
+REM start and stop via erlsrv reports no error message. Using net instead
+net !P1! !RABBITMQ_SERVICENAME!
+if ERRORLEVEL 1 (
+ EXIT /B 1
+)
+goto END
+
:END
EXIT /B 0