tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ricardo L. A. Bánffy <rban...@mac.com>
Subject Re: Starting Tomcat as an NT service
Date Wed, 11 Oct 2000 16:32:34 GMT
Can't you put the source on the CVS tree?

Isn't there any place better to put it?
----- Original Message -----
From: <Pierre.Damas@cec.eu.int>
To: <tomcat-dev@jakarta.apache.org>
Sent: Wednesday, October 11, 2000 12:02 PM
Subject: Starting Tomcat as an NT service


> I noticed that there was a need with High priority for a program allowing
> Tomcat to start as a service on the NT platform.
>
> Here is version 1.0 of TomcatSVC, the Tomcat Start/Stop Service.
>
> 0) What it does?
>
> TomcatSVC can first install and remove itself easily just with a
> command-line option.
>
> On installation, it installs itself as a service running in the System
> context, and starting automatically (at next reboot).
> When started, it starts Tomcat by running "tomcat.bat" with the "run"
> parameter, then waits indefinitely for a stop signal.
> When stopped, it stops Tomcat by running "tomcat.bat" with the "stop"
> parameter, and stops.
>
> Tomcat is started invisibly, except if you check "Allow Service to
Interact
> with the Desktop" in the Control Panel, Services, Tomcat Start/Stop
Service.
>
> If the system is shut down, the service runs "tomcat stop" in a last
attempt
> to stop it before exiting.  Although it worked fine during the tests, I
> cannot guarantee that launching a Java program during system shutdown will
> always succeed.
>
> 1) User Notes
>
> Copy the TomcatSVC executable in the %TOMCAT_HOME%\bin directory (where
the
> tomcat.bat resides)
> On the command line, type "TomcatSVC -install".  The service is installed
to
> be started automatically at next reboot.
> Type "NET START TomcatSVC" to start the service.  Enjoy your work.
> Type "NET STOP TomcatSVC" to stop tomcat, or it will stop during shutdown.
>
> Attention 1:
> Your Tomcat.bat must contain all the environment variable settings to make
> Tomcat work properly, and contain no pause.
> To debug what is happening, start it interactively (TomcatSVC -debug).
> %TOMCAT_HOME% is guessed in tomcat.bat by finding tomcat.bat in the
current
> directory.  The current directory is set by default as the directory where
> the service executable resides.
>
> Attention 2:
> If you issue the command: "tomcat stop" at the command line, Tomcat will
> stop, but the service will continue running.
> You will have to stop it (it will attempt to stop Tomcat at that moment)
and
> restart it to restart Tomcat as a service.  This is not a bug.
>
> 2) System Notes
>
> During installation, the service will check in which directory it is, and
> save it in the registry key
>
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TomcatSVC\Parameters\In
> stallDir.  It will use that value as default directory when starting
> tomcat.bat.
> The service will store its START and STOP commands under the keys
>
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TomcatSVC\Parameters\St
> art
>
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TomcatSVC\Parameters\St
> op,
> containing the full path to tomcat.bat.  If you change your Tomcat
> directory, stop the service, uninstall it (TomcatSVC -remove) and
reinstall
> it (TomcatSVC -install)
>
> Shutdown problem:
> If Tomcat is visible ("Allow Service to Interact with the Desktop"
checked),
> the shutdown will fail since the Tomcat window will first receive the
> message to close, and will be forced to stop if it doesn't answer.
> Moreover, the creation of the new window by the tomcat stop command will
> fail because the system is shutting down.
> So, if you see your Tomcat window, stop the service before shutting down
> ("NET STOP TomcatSVC").
>
> Interactive debugging:
> Typing TomcatSVC -debug will execute the start command found in the
registry
> in the same command window.
>
> Sources and license:
> I started this project by using Sample Code from the Microsoft Platform
SDK.
>
> The license states:
> * Sample Code.  You may modify the sample source code located in the
> SOFTWARE PRODUCT's "samples" directories
> ("Sample Code") to design, develop, and test your Application solely for
use
> with a Microsoft Operating System Product.  You may also reproduce and
> distribute the Sample Code in ***object code*** form along with any
> modifications you make to the Sample Code, provided that you comply with
the
> Distribution Terms described below.  For purposes of this section,
> "modifications" shall mean enhancements to the functionality of the Sample
> Code.
>
> So, be sure to only use this service with a Microsoft Operating System
;-).
>
> I'll pass personally the source to the person who wants to maintain and
> continue this service, but I'm not sure it is advisable to make it public
> due to the difference of licensing scheme between MS and Apache...  I
attach
> the full licence of the platform SDK so that you can check yourself what
can
> be done on that issue.
>
> Pierre A. Damas
>
>


----------------------------------------------------------------------------
----


> ---------------------------------------------------------------------
> 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