tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mladen Turk <mt...@apache.org>
Subject Re: Changing the Tomcat5 WIN32 service runner
Date Thu, 24 Feb 2005 06:25:48 GMT
Costin Manolache wrote:
> William A. Rowe, Jr. wrote:
> 
> Would it be possible to have the signals intercepted and cause the
> execution of the .bat file with different params ( like 'stop' or 
> 'reload' or 'start' ), similar with unix init.d files ?
>

Yes, that was the idea.
Here is the example from the svn.

@echo off
@if not "%ECHO%" == ""  echo %ECHO%
@if "%OS%" == "Windows_NT"  setlocal

set SERVICE_EXECUTABLE=example.exe

REM Figure out the running mode

@if "%1" == "install"   goto cmdInstall
@if "%1" == "uninstall" goto cmdUninstall
@if "%1" == "start"     goto cmdStart
@if "%1" == "stop"      goto cmdStop
@if "%1" == "restart"   goto cmdRestart
echo Usage
goto cmdEnd

:cmdInstall
..\Debug\srvbatch.exe -iwdcl SrvbatchExample "%CD%" "Srvbatch Example 
Service" "This is an Example service" exservice.bat
goto cmdEnd

:cmdUninstall
..\Debug\srvbatch.exe -u SrvbatchExample
goto cmdEnd

:cmdStart
%SERVICE_EXECUTABLE% start
goto cmdEnd

:cmdStop
%SERVICE_EXECUTABLE% stop
goto cmdEnd

:cmdRestart
%SERVICE_EXECUTABLE% stop
%SERVICE_EXECUTABLE% start
goto cmdEnd

:cmdEnd

So just set SERVICE_EXECUTABLE to catalina.bat

> I like the idea of running a .bat ( or arbitrary .exe ) as a service 
> based on the analogy with the init.d files - but it needs the 
> stop/restart as well.
> 

Well, it's much easier to maintain setups when you have multiple
servers. You don't need to edit the registry for runtime params.

OTOH it has overhead of spawning aditional cmd.exe, so this perhaps
will be better used as additional package rather then default service
runner.


Mladen.

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Mime
View raw message