PDA

View Full Version : Starting and Stopping Tomcat ...



mplanchart
03-15-2006, 01:21 PM
Hi,

I need to stop Tomcat in order to install a web application WAR file and then start it up again.

What well-proven technique is out there?

I greatly appreciate the feedback!

Thanks

Eyal Goren
03-15-2006, 08:30 PM
Best to my knowledge, there is no standard way of stopping tomcat, just killing the process.

But- perhaps in latest versions it was changed...

mplanchart
03-16-2006, 02:08 PM
How can I exectue a .bat file???

Wouldn't this be a way of restarting Tomcat, by running a batch file on the target windows machine?

This is only necessary if Tomcat's autodeploy attribute is set to false.

Thanks

davbrown2
04-21-2006, 07:25 PM
If tomcat is running as a Windows service (e.g. you used "service.bat" to install it as a Windows service), you can either:

* invoke NET START and NET STOP commands to start and stop the service.

* Can you use VBScript with MultiPlatform? - the following is something I used with an MSI installer, but I suspect that it could be modified to be invoked from ISMP (you would need to get the service name from something other than Session.Property..)

Dim objShell
dim sServiceName


Function StartService()

sServiceName = Session.Property("SERVICENAME")

Set objShell=CreateObject("Shell.Application")

If objShell.ServiceStart(sServiceName, FALSE) Then
StartService = True
Else
StartService = False
End If

End Function


Function StopService()

sServiceName = Session.Property("SERVICENAME")

Set objShell=CreateObject("Shell.Application")

If objShell.ServiceStop(sServiceName, FALSE) Then
StopService = True
Else
StopService = False
End If

End Function

Christopher Painter
04-21-2006, 08:51 PM
I think the point is multiplatform might not be windows so no SCM and no scripting host.