tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Johnny Kewl" <j...@kewlstuff.co.za>
Subject Re: Blocking port 8005 in TomCat in Deamon Mode
Date Thu, 10 Jul 2008 15:15:33 GMT

----- Original Message ----- 
From: "Suma Rakesh" <suma_rakesh@yahoo.com>
To: <users@tomcat.apache.org>
Sent: Thursday, July 10, 2008 2:03 AM
Subject: Blocking port 8005 in TomCat in Deamon Mode


>> Hi,
>>
>> I am starting Tomcat through one of my C++ programs on
>> windows 2003 server. I am using Bootsrap
>> org.apache.catalina.startup.Bootstrap.main() method and
>> pass 'Start' and 'Stop' as arguments.
>>
>> The documentation  read mentioned that this will start
>> tomcat in daemon mode. However, tomcat still listens on
>> port 8005 (another document mentioned that if started in
>> deamon mode Tomcat will not listen on port 8005)  and I am
>> able to send SHUTDOWN command on this porton local machine.
>> I am not able to do a telnet on port 8005 and send SHUTDOWN
>> command from remote machine though.
>>
>> I would like to block accepting commands on 8005 from local
>> machine as well. Has anyone tried this out? Do you have any
>> pointers ?
>>
>> Regards,
>> Suma.

Suma its that "await" command thats creating the shutdown port...

In your code you going to have a thread.... the java equiv of this...

run(){
                await(); //make a shutdown port default 8005 (this thread 
will block at start)
                load(); //load up all the config stuff
                start(); //Run TC
}

If you dont have the await... your thread will fall thru and TC will end.... 
its much easier to use TC's blocking trickery... its the stuff that makes a 
dos box stick around... that await() thing.

I dont think there is anything stopping you from doing it in your C code... 
but I think you'll end up reinventing the wheel... how will you hold your 
thread?
That 8005 port can be changed and listens on localhost... its in the 
StandardServer await() method..
I'm actually not sure what will happen... but I think

run(){
                // Take it out await(); //make a shutdown port default 8005 
(this thread will block at start)
                load(); //load up all the config stuff
                start(); //Run TC

                wait()....  or sleep.... or whatever

}

will stop the TC thread....

Embedding TC must do the threading a little different to catalina... but 
there you lose that load stuff... ie no auto config.

I think life will be alot easier living with the shutdown port ;)

BTW... its this relationship between catalina and digester .... and what I 
view as a totally different mechnism when embedding, that I think TC could 
improve on.
Get embedding.... juat a command line away from the main server, instead of 
a totally different approach...

We "embed" thru catalina... not embedded as well... you need the port ;)

---------------------------------------------------------------------------
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: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message