Re: Changing the Tomcat5 WIN32 service runner

2005-02-24 Thread Costin Manolache
Mladen Turk wrote:
@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

I assume the '.bat' is the only option - i.e. could you use arbitrary 
'executables' or other 'scripting languages' ? I.e. if you have cygwin 
or equivalent installed - could it execute a .sh ? Or if you have 
different scripting engine - could it run the .js or .py instead of 
.bat? And the most interesting - could you specify an executable .jar as 
the command ?

It's just that .bat is one of the ugliest scripting languages...
Having the unix-style service mechanism, i.e. a script with 
start/stop/etc is IMO a step forward and makes it much easier to
deal with services.

Costin
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Changing the Tomcat5 WIN32 service runner

2005-02-23 Thread Costin Manolache
William A. Rowe, Jr. wrote:
At 06:31 AM 2/21/2005, Mladen Turk wrote:

Unlike any other java or java/jni implementations
it does not tries to make a java as a service, but
rather makes a batch (.bat) file as a service.

IIUC, that means;
  1. service signals (shutdown etc) aren't recognized by cmd 
 (sh for you linux observers) in any useful manner.

  2. it invokes cmd, which invokes the apps.  You are stuck
 with an instance of cmd for the lifetime of the process.
Seems like a big leap backwards, IMHO.  If anything, a psuedo-sh
script interpreter which picked up the envvar assignments (the
only thing you want to move to .cmd for, anyways) makes more
sense than this.
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 ?

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.

Costin
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Changing the Tomcat5 WIN32 service runner

2005-02-23 Thread Mladen Turk
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Changing the Tomcat5 WIN32 service runner

2005-02-21 Thread Mladen Turk
Hi,
For anyone interested there is a new project for
jakarata-commons/daemon procrun named *srvbatch*,
siting there for couple of months.
Unlike any other java or java/jni implementations
it does not tries to make a java as a service, but
rather makes a batch (.bat) file as a service.
This way the same configuration (catalina.bat)
can be used both for running from command line or
for running from service.
It usually needs a separate batch file that is closely
related to any unix service file (see exservice.bat).
What do you think that we change the current
windows distribution to follow this new concept?
IMO it's more simpler and stable then current
way the procrun is used.
Regards,
Mladen
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Changing the Tomcat5 WIN32 service runner

2005-02-21 Thread Remy Maucherat
Mladen Turk wrote:
Hi,
For anyone interested there is a new project for
jakarata-commons/daemon procrun named *srvbatch*,
siting there for couple of months.
Unlike any other java or java/jni implementations
it does not tries to make a java as a service, but
rather makes a batch (.bat) file as a service.
This way the same configuration (catalina.bat)
can be used both for running from command line or
for running from service.
It usually needs a separate batch file that is closely
related to any unix service file (see exservice.bat).
What do you think that we change the current
windows distribution to follow this new concept?
IMO it's more simpler and stable then current
way the procrun is used.
I'm not in favor of that :( I hate .bat files, so ...
Rmy
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Changing the Tomcat5 WIN32 service runner

2005-02-21 Thread William A. Rowe, Jr.
At 06:31 AM 2/21/2005, Mladen Turk wrote:

Unlike any other java or java/jni implementations
it does not tries to make a java as a service, but
rather makes a batch (.bat) file as a service.

IIUC, that means;

  1. service signals (shutdown etc) aren't recognized by cmd 
 (sh for you linux observers) in any useful manner.

  2. it invokes cmd, which invokes the apps.  You are stuck
 with an instance of cmd for the lifetime of the process.

Seems like a big leap backwards, IMHO.  If anything, a psuedo-sh
script interpreter which picked up the envvar assignments (the
only thing you want to move to .cmd for, anyways) makes more
sense than this.




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]