You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Andy Armstrong <an...@tagish.com> on 2001/07/26 19:31:49 UTC

Different approach to TC as a service (was: Separating Service code from Tomcat 4.0)

Hi Joe et al,

Joe Flowers wrote:
[snip cogent words about running TC as a service]

I agree with you 100% WRT the difficulty of getting JavaService to work
-- a sysadmin here pulled most of his few remaining hairs one day trying
to get it working, so while I haven't personally looked at it I can well
sympathize.

For the Domino connector I took a slightly different approach: the
Domino connector can optionally be configured to start Tomcat when it
loads. This has a number of benefits including

  * simplified installation
  * assurance that Tomcat starts and stops at the right time relative to
    the web server's lifecycle
  * conceptually portable

By "conceptually portable" I mean that while the code in the connector
to implement Tomcat startup and shutdown isn't the same for all
platforms the concept of running Tomcat in that way is -- you can safely
assume that whatever the platform the admin has already arranged for the
web server to start automatically if that's what they want, and the
arrangements for starting Tomcat at the same time are essentially the
same across all platforms.

It would be easy enough to add the same functionality to the other
connectors. This is a simple solution for all platforms in all cases
except the one where you want to have Tomcat autostart in stand-alone
mode, and I would assume that that's a relatively rare requirement.

If there's interest I can investigate adding the same functionality to
the other connectors.

-- 
Andy Armstrong, Tagish

Re: Different approach to TC as a service (was: Separating Service code from Tomcat 4.0)

Posted by Andy Armstrong <an...@tagish.com>.
Remy Maucherat wrote:
> 
> Quoting Andy Armstrong <an...@tagish.com>:
> 
> > Hi Joe et al,
> >
> > Joe Flowers wrote:
> > [snip cogent words about running TC as a service]
> >
> > I agree with you 100% WRT the difficulty of getting JavaService to work
> > -- a sysadmin here pulled most of his few remaining hairs one day
> > trying
> > to get it working, so while I haven't personally looked at it I can
> > well
> > sympathize.
> 
> Yes, I can also confirm it's extremely hard to do too. One time, I forgot to
> check the "NT Service" check box in the installer, and it failed to install !!!
> 
> ;-)
> 
> So the bottom line is : give it another try using the installer (and keep your
> hair :) ). Maybe bugs were fixed or something like that.

It wasn't my hair -- I don't have any any more ;-)

-- 
Andy Armstrong, Tagish

Re: Different approach to TC as a service (was: Separating Service code from Tomcat 4.0)

Posted by Remy Maucherat <re...@betaversion.org>.
Quoting Andy Armstrong <an...@tagish.com>:

> Hi Joe et al,
> 
> Joe Flowers wrote:
> [snip cogent words about running TC as a service]
> 
> I agree with you 100% WRT the difficulty of getting JavaService to work
> -- a sysadmin here pulled most of his few remaining hairs one day
> trying
> to get it working, so while I haven't personally looked at it I can
> well
> sympathize.

Yes, I can also confirm it's extremely hard to do too. One time, I forgot to 
check the "NT Service" check box in the installer, and it failed to install !!!

;-)

So the bottom line is : give it another try using the installer (and keep your 
hair :) ). Maybe bugs were fixed or something like that.

Remy

Re: Different approach to TC as a service (was: Separating Service code from Tomcat 4.0)

Posted by cm...@yahoo.com.
On Thu, 26 Jul 2001, Andy Armstrong wrote:

> By "conceptually portable" I mean that while the code in the connector
> to implement Tomcat startup and shutdown isn't the same for all
> platforms the concept of running Tomcat in that way is -- you can safely
> assume that whatever the platform the admin has already arranged for the
> web server to start automatically if that's what they want, and the
> arrangements for starting Tomcat at the same time are essentially the
> same across all platforms.

+1 for adding this in jk.

BTW, jk already has the feature if JNI connector is used - but it would be
great to be able to do the same for ajp connectors. Probably using the
same config file ( most of the information to start tomcat is similar -
the jni configuration file allows you to specify env variables,
classpaths, etc ).

One question - is anyone using the jk_service ( the NT service starter
that is included with tomcat3.x ) ?

( BTW, If you like modularity, it can even be developed as a separate
module,  independent of jk - that will keep the complexity under control.)


Costin



Re: Different approach to TC as a service (was:SeparatingServicecode from Tomcat 4.0)

Posted by Andy Armstrong <an...@tagish.com>.
"Pier P. Fumagalli" wrote:
[snip]
> > I'll do some reading. Do you recall whether the problems where specific
> > to that implementation of the startup code or more generically related
> > to having the servlet container autostart?
> 
> Oh, I remember it was about invoking the startup script, and also one big
> hassle was to shut down JServ from Apache, connecting to the port to issue a
> shutdown command...

For the Domino connector I just do bin/tomcat.sh start or bin/tomcat.sh
stop appropriately. It seems to work OK and is very simple to implement.

-- 
Andy Armstrong, Tagish

Re: Different approach to TC as a service (was:SeparatingServicecode from Tomcat 4.0)

Posted by jean-frederic clere <jf...@fujitsu-siemens.com>.
"Pier P. Fumagalli" wrote:
> 
> Andy Armstrong at andy@tagish.com wrote:
> 
> > "Pier P. Fumagalli" wrote:
> >>
> >> Andy Armstrong at andy@tagish.com wrote:
> >>>
> >>> I only used JServ briefly before switching to Tomcat and "it worked for
> >>> me"(tm). Can you recall any of the specific problems?
> >>
> >> It was back in 1997, and I remember several patches across 2 months from Ed
> >> Korthof just to "make it work". But you should get back and see the
> >> archives.
> >>
> >> I remember it was a big pain in the ass (and that for Jserv 1.0 I  was
> >> always starting Jserv stand alone!)

Things improved ApacheJServ-1.1.2 works without problems on our BS2000 EBCDIC
mainframes.
The idea to have:
httpd <--> "watchdog process" <--> service <--> JVM with Tomcat
Sounds Ok for me.

> >
> > I'll do some reading. Do you recall whether the problems where specific
> > to that implementation of the startup code or more generically related
> > to having the servlet container autostart?
> 
> Oh, I remember it was about invoking the startup script, and also one big
> hassle was to shut down JServ from Apache, connecting to the port to issue a
> shutdown command...

Good that remains me that I have to patch mod_jserv, that "watchdog" process
holds the listen socket and it should not. (That does "Address already in use"
making apachectl graceful when using mod_jserv).
That is the only problem I have with mod_jserv :-)

> 
>     Pier

Re: Different approach to TC as a service (was: SeparatingServicecode from Tomcat 4.0)

Posted by "Pier P. Fumagalli" <pi...@betaversion.org>.
Andy Armstrong at andy@tagish.com wrote:

> "Pier P. Fumagalli" wrote:
>> 
>> Andy Armstrong at andy@tagish.com wrote:
>>> 
>>> I only used JServ briefly before switching to Tomcat and "it worked for
>>> me"(tm). Can you recall any of the specific problems?
>> 
>> It was back in 1997, and I remember several patches across 2 months from Ed
>> Korthof just to "make it work". But you should get back and see the
>> archives.
>> 
>> I remember it was a big pain in the ass (and that for Jserv 1.0 I  was
>> always starting Jserv stand alone!)
> 
> I'll do some reading. Do you recall whether the problems where specific
> to that implementation of the startup code or more generically related
> to having the servlet container autostart?

Oh, I remember it was about invoking the startup script, and also one big
hassle was to shut down JServ from Apache, connecting to the port to issue a
shutdown command...

    Pier


Re: Different approach to TC as a service (was: SeparatingServicecode from Tomcat 4.0)

Posted by Andy Armstrong <an...@tagish.com>.
"Pier P. Fumagalli" wrote:
> 
> Andy Armstrong at andy@tagish.com wrote:
> >
> > I only used JServ briefly before switching to Tomcat and "it worked for
> > me"(tm). Can you recall any of the specific problems?
> 
> It was back in 1997, and I remember several patches across 2 months from Ed
> Korthof just to "make it work". But you should get back and see the
> archives.
> 
> I remember it was a big pain in the ass (and that for Jserv 1.0 I  was
> always starting Jserv stand alone!)

I'll do some reading. Do you recall whether the problems where specific
to that implementation of the startup code or more generically related
to having the servlet container autostart?

-- 
Andy Armstrong, Tagish

Re: Different approach to TC as a service (was: SeparatingService code from Tomcat 4.0)

Posted by "Pier P. Fumagalli" <pi...@betaversion.org>.
Andy Armstrong at andy@tagish.com wrote:
> 
> I only used JServ briefly before switching to Tomcat and "it worked for
> me"(tm). Can you recall any of the specific problems?

It was back in 1997, and I remember several patches across 2 months from Ed
Korthof just to "make it work". But you should get back and see the
archives.

I remember it was a big pain in the ass (and that for Jserv 1.0 I  was
always starting Jserv stand alone!)

    Pier


Re: Different approach to TC as a service (was: SeparatingService code from Tomcat 4.0)

Posted by Andy Armstrong <an...@tagish.com>.
"Pier P. Fumagalli" wrote:
> 
> Andy Armstrong at andy@tagish.com wrote:
> >
> > If there's interest I can investigate adding the same functionality to
> > the other connectors.
> 
> I would not want to see it in webapp... Autostart was the major headache
> back in JServ days... I wouldn't want to have to deal with the same thing
> again.
> 
>     Pier

I only used JServ briefly before switching to Tomcat and "it worked for
me"(tm). Can you recall any of the specific problems?

-- 
Andy Armstrong, Tagish

Re: Different approach to TC as a service (was: Separating Service code from Tomcat 4.0)

Posted by "Pier P. Fumagalli" <pi...@betaversion.org>.
Andy Armstrong at andy@tagish.com wrote:
> 
> If there's interest I can investigate adding the same functionality to
> the other connectors.

I would not want to see it in webapp... Autostart was the major headache
back in JServ days... I wouldn't want to have to deal with the same thing
again.

    Pier