Skip to content

Commit

Permalink
Merge pull request #1326 from rabbitmq/rabbitmq-server-1324
Browse files Browse the repository at this point in the history
Start/stop windows service using `net` utility instead of `erlsrv`
  • Loading branch information
michaelklishin committed Aug 10, 2017
2 parents fd50fd7 + 514ae58 commit b02a53e
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions scripts/rabbitmq-service.bat
Expand Up @@ -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 *********************
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit b02a53e

Please sign in to comment.