----- Original Message -----
From: "André Warnier" <[EMAIL PROTECTED]>
To: "Tomcat Users List" <users@tomcat.apache.org>
Sent: Sunday, September 21, 2008 1:41 AM
Subject: Tomcat 5.5 / Windows / procrun ?
Hi.
I have Tomcat 5.5 running on a variety of platforms, among them Windows XP
(my laptop) and Windows 2003 server.
For the Windows installation, until now I have been using the Windows
Service Installer from the Tomcat 5.5 download page, and it works fine.
But could someone shed some light on the following puzzle ?
A recent discussion on this list triggered my curiosity, and as a result I
bumped into several things :
- the installer for Windows installs a version of Tomcat 5.5 devoid of the
usual "startup.sh/bat", "catalina.sh/bat" etc.. and instead just installs
a couple of files in Tomcat_home\bin, of which a tomcat5.exe (which seems
to be the Tomcat executable), and a tomcat5w.exe which is the Windows GUI
allowing to configure the Tomcat service..
- the "ImagePath" Registry entry for the Tomcat 5.5 Service shows this :
C:\Tomcat5.5\bin\tomcat5.exe //RS//Tomcat5
- On the Tomcat 5.5 download page, in addition to the installer, there
also exists a Tomcat 5.5 zip file. That one seems to contain the full
complement of usual files of Tomcat, including Tomcat_home\bin, plus the
tomcat5.exe and tomcat5w.exe which are also in the installer package.
It also contains a file "service.bat" which is described nowhere, but
seesm to be related to the procrun item of which question below.
The Tomcat 5.5 and Tomcat 6 on-line documentation, setup page, section for
Windows, only seem to mention the Installer package. There is a link on
both the 5.5 and 6.0 Windows setup sections, pointing to a "Windows
Service HowTo", which leads to a page mentioning "procrun 1.0", but in the
same breath indicating that it is now obsolete.
Digging further, I found a link to the Apache Commons project "Daemon",
which seems to include this "procrun" for Windows, and also a "jsvc" for
Unix.
The page there relative to procrun,
(http://commons.apache.org/daemon/procrun.html)
apart from being relatively difficult to read, seems interesting and
seems to match the way my Windows Tomcat 5.5 instances are really
installed and running.
(See registry line above).
But I found nowhere a link to download this procrun in binary form.
I also did not find any link there pointing to any other version of
procrun...
On the other side of things, this same Apache Commons Daemon project also
covers a "jsvc", which seems to be a wrapper allowing to "run Tomcat as a
daemon under Unix/Linux".
I believe I have seen mentions of this jsvc in some Tomcat documents (or
in this forum ?), but at any rate my Tomcat Debian Linux systems seem to
run Tomcat 5.5 as daemon perfectly fine, without seeming to use this jsvc
module.
So I wonder what it is used for.
What I kind of piece together of all this is as follows :
- the packagers of Tomcat 5.5 and Tomcat 6 for Windows use this procrun
program (in whatever version, but probably not 1.0), to take the java JVM
executable and make it into a Windows service which runs Tomcat.
This Windows Service executable is named tomcat5.exe in the msi
distribution. (Or else this tomcat5.exe is not really java packaged as a
service, but just a stub pointing to an installed Java jvm dll).
Anyway the result is packaged, together with the other Tomcat components,
into a Windows Service Installer package which is the one on the Tomcat
download page.
- the documentation of this procrun (or whatever is related to it for
Tomcat), on the Tomcat site, is out-of-date and does not match the version
of procrun that is being used above.
- the procrun program is a general utility that allows to take any Java
program (or any program ?) and turn it into a Windows service. It thus
seems to be something like the old "srvany" workhorse, but a bit more
sophisticated. But this procrun program does not seem to be available for
download in binary form.
- and I don't have a clue as to what jsvc may be for.
Thanks
André
-----------------------
Thats about right from when I looked at it a while back...
Java can be controlled from C... thats what the libs do... there is a linux
and windows version...
If you look at the tomcat bootstrap class, you will see it has the
(interface) methods that Procrun calls into.
So its just a windows service that starts the java engine, and calls into a
java class to get it running...
If you want the binary for procrun... its just the tomcatX.exe file...
rename it... ha ha
The TomcatW file is just a human interface... probably talking directly to
the windows registry (params).
service bat... lets a user get it installed...
So if you have the TC zip version and want to install it as a service...
service install
will do it.
The real problem with installing TC from a zip is just that the APR is not
there... and its a mission to guess the right one...
Stupid window users like myself... like setup and forget... makes clients
happy as well ;)
jsvc is probably a legacy from the early days when tomcat was no packed into
linux dists... and very like a component in any linux dist, be it under a
diff name.
The original problem when java came out that every one asked was how to get
a service going which needed to control the jre from C...
If you have a look at the source... how C does control the JRE is quite
interesting.
Hidden Sun secrets... ha ha
Inside that deamon bundle there is a procrun source VS6 project...
Of course because Microsfot has changed the C standards so much in their new
stuff... so they can try make a Java under the name of "Managed" cockup
(dotNet), these projects are near impossible to compile in new MS tools...
Gates is protecting his turf...
Actually the real problem is that Java makes string so easy, MS had to
modify all their tools to steal it ;)
But if you dig around in the Apache projects... its a gold mine, if you know
what you looking for ;)
... just keep your old MS tools ;)
Look inside service.bat... remember that tomcat.exe is actually procrun...
and you can turn ANY jave program into a service with just those two
files...
... neat hey ;)
---------------------------------------------------------------------------
HARBOR : http://www.kewlstuff.co.za/index.htm
The most powerful application server on earth.
The only real POJO Application Server.
See it in Action : http://www.kewlstuff.co.za/cd_tut_swf/whatisejb1.htm
---------------------------------------------------------------------------
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]