Discussion:
Tomcat really need Shutdown port
SRamasamy
2009-11-13 21:42:08 UTC
Permalink
Please let me know tomcat really need shutdown port to shutdown server. I go
though some google its show tomcat default it listen port 8005 to shutdown.
I have removed port but its working. let me know how its working after
removing shutdonw port ?
1. Server shutdown="SHUTDOWN"
--
View this message in context: http://old.nabble.com/Tomcat-really-need-Shutdown-port-tp26343993p26343993.html
Sent from the Tomcat - User mailing list archive at Nabble.com.
Caldarale, Charles R
2009-11-13 21:46:16 UTC
Permalink
Subject: Tomcat really need Shutdown port
I have removed port but its working. let me know how its working after
removing shutdonw port ?
Without the shutdown port, you will not be able to stop Tomcat via the normal scripts. You can terminate the Tomcat process by whatever means your OS provides, but I wouldn't recommend that.

- Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.
Mark Thomas
2009-11-13 22:24:44 UTC
Permalink
Post by Caldarale, Charles R
Subject: Tomcat really need Shutdown port
I have removed port but its working. let me know how its working after
removing shutdonw port ?
Without the shutdown port, you will not be able to stop Tomcat via the normal scripts. You can terminate the Tomcat process by whatever means your OS provides, but I wouldn't recommend that.
If you set the shutdown port to -1 then the standard process kill (ie kill -15
<pid> on linux) will perform a standard, perfectly safe shutdown identical to
what you would get if the shutdown script worked (which it won't without a
shutdown port)

Mark
Caldarale, Charles R
2009-11-13 22:27:40 UTC
Permalink
Subject: Re: Tomcat really need Shutdown port
If you set the shutdown port to -1 then the standard process
kill (ie kill -15 <pid> on linux) will perform a standard,
perfectly safe shutdown identical to what you would get if
the shutdown script worked (which it won't without a shutdown
port)
Good to know. Anything equivalent for Windows?

- Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.
Pid
2009-11-13 23:25:54 UTC
Permalink
Post by Caldarale, Charles R
Subject: Re: Tomcat really need Shutdown port
If you set the shutdown port to -1 then the standard process
kill (ie kill -15<pid> on linux) will perform a standard,
perfectly safe shutdown identical to what you would get if
the shutdown script worked (which it won't without a shutdown
port)
Good to know. Anything equivalent for Windows?
Yep. There's normally a button on the front of the machine. ;)


p
Post by Caldarale, Charles R
- Chuck
THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.
---------------------------------------------------------------------
Mark Thomas
2009-11-14 00:18:13 UTC
Permalink
Post by Caldarale, Charles R
Subject: Re: Tomcat really need Shutdown port
If you set the shutdown port to -1 then the standard process
kill (ie kill -15 <pid> on linux) will perform a standard,
perfectly safe shutdown identical to what you would get if
the shutdown script worked (which it won't without a shutdown
port)
Good to know. Anything equivalent for Windows?
CTRL-C if running in a console. If running as a service, I don't *think* the
shutdown port is used but you'd have to check. I'd test it / check the source
myself, but I'm in the middle of something else I need to finish at the moment.

Mark
Caldarale, Charles R
2009-11-14 00:52:03 UTC
Permalink
Subject: Re: Tomcat really need Shutdown port
CTRL-C if running in a console.
I verified that CTRL-C does a clean shutdown. Terminating via Task Manager or the close button on the command window causes abrupt termination, not a good thing.
If running as a service, I don't *think* the
shutdown port is used but you'd have to check.
The shutdown port does not appear to be necessary, although the following message does appear in the logs:

SEVERE: No shutdown port configured in server.xml. Please shut down server through OS signal. Server not shut down by external JVM.

The above is immediately followed by a clean shutdown. This appears to be true using either tomcat6w.exe or the Services snap-in.

(All the above was done with the shutdown port set to -1.)

- Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.
Bill Barker
2009-11-14 02:26:58 UTC
Permalink
Post by Mark Thomas
Post by Caldarale, Charles R
Subject: Re: Tomcat really need Shutdown port
If you set the shutdown port to -1 then the standard process
kill (ie kill -15 <pid> on linux) will perform a standard,
perfectly safe shutdown identical to what you would get if
the shutdown script worked (which it won't without a shutdown
port)
Good to know. Anything equivalent for Windows?
CTRL-C if running in a console. If running as a service, I don't *think* the
shutdown port is used but you'd have to check. I'd test it / check the source
myself, but I'm in the middle of something else I need to finish at the moment.
On *nix, jsvc doesn't use the shutdown port (it has it's own signal handling
to do a clean shutdown).

On Windows, you need the shutdown port (so that anybody with physical access
to the machine can shutdown the service by using the scripts). This is
because tomcatN.exe doesn't keep a thread alive on it's own after starting
Tomcat, so there are no non-daemon threads left and Tomcat shuts down.
Post by Mark Thomas
Mark
Caldarale, Charles R
2009-11-14 02:53:33 UTC
Permalink
Subject: Re: Tomcat really need Shutdown port
On Windows, you need the shutdown port (so that anybody with physical
access to the machine can shutdown the service by using the scripts).
The above seems to conflict with the results of my experiments running 6.0.20 as a service on Vista 64.
This is because tomcatN.exe doesn't keep a thread alive on it's own
after starting Tomcat, so there are no non-daemon threads left and
Tomcat shuts down.
That's not the behavior I observed, nor is it reflected in the code. There's a check for port == -1 in StandardServer.await() that repeatedly sleeps for 10 seconds waiting for a stop flag to be set. Setting the port to -2 causes an immediate return from the await() method, while any other value attempts to acquire a socket for the specified port.

The original thread from tomcat6.exe does appear to have exited, although its Thread object is still around.

- Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.
SRama
2009-11-14 11:59:37 UTC
Permalink
Dear Guys,
As of my knowledge and other tomcat related document and experts response
it’s states we need tomcat port need to shuts down for windows.

I have one more clarification regarding tomcat port

Over view of my product: our product based developed by struts web
application its running on tomcat it’s in the form of CDROM , tomcat contain
more than one we application and also I am giving link to the each
application on destop and start of menu once user click the link it point
static page and it will call startup.bat file so each application same line
I am giving link and it will point same startup.bat file.

We are hiding tomcat status console. So it will not show any excepton if
user clink more than one time it will call stat.bat file but application
running fine. But log its shows some tomcat start error is coming. Next
import point we are not shutdown server because user don’t want to see the
tomcat console so we are just leaving server when user will restart machine
then will system will remove instance from memory. I know this is not way to
program.

Let me know we are not shut down server when user wants to remove
application from machine I am giving option to remove entire setup once user
click the remove link it will remove all the files from system at the time I
am trying to stop the server and removing here only I need tomcat shut down
port but I have removed tomcat shut down port after running web application
when I try to remove its getting removed without any issues.

My question is there any way to set up time to stop the server like after
two or 3 hours?

How tomcat instance are getting removed from memory without shutdown port?
Based on this scenario can I go without tomcat shutdown port on windows?
Are you thing it will any problem to future because of tomcat port?
If user wants uninstall my application then only I am calling shutdown and
removing files from the machine so I don’t need further so please let me
know based on this scenario tomcat need down port?
if i remove shutdonw port tomcat will take any default port ?
--
View this message in context: http://old.nabble.com/Tomcat-really-need-Shutdown-port-tp26343993p26349432.html
Sent from the Tomcat - User mailing list archive at Nabble.com.
Caldarale, Charles R
2009-11-14 15:15:55 UTC
Permalink
Subject: RE: Tomcat really need Shutdown port
As of my knowledge and other tomcat related document and experts
response it’s states we need tomcat port need to shuts down for
windows.
Read all the responses; you do *not* need the shutdown port in Windows. If running Tomcat as a service, the shutdown works with the port set to -1 by generating a shutdown signal to the Tomcat process. If running Tomcat from a command prompt, use CTRL-C to terminate Tomcat cleanly.
I am giving link to the each application on destop and start of
menu once user click the link it point static page and it will
call startup.bat file so each application same line I am giving
link and it will point same startup.bat file.
That's bad; each time the user clicks the link a new instance of Tomcat will start, all but the first of which will die due to port conflicts. Sloppy, at best. You should have the links target your own script that determines whether or not Tomcat is running and starts it only when needed.
Next import point we are not shutdown server because user don’t
want to see the tomcat console so we are just leaving server when
user will restart machine then will system will remove instance
from memory.
That would be a guaranteed reason for me *not* to buy your application.
My question is there any way to set up time to stop the server like
after two or 3 hours?
Configure a lifecycle listener for each webapp; if there's no activity for any of them over the desired time period, send the shutdown signal.

It's probably easiest for you to leave the shutdown port configured, but use a different password. Since the user has complete control of the machine, the user can kill the Tomcat process any time he or she chooses, so the presence of the shutdown port listener is not really a concern.

- Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from a
Ziggy
2009-11-14 15:53:13 UTC
Permalink
If you dont configure the shutdown port how will tomcat know which instance
to shutdown if you have configured mulitple tomcat instances using multiple
catalina_bases??


On Sat, Nov 14, 2009 at 3:15 PM, Caldarale, Charles R <
Post by Caldarale, Charles R
Subject: RE: Tomcat really need Shutdown port
As of my knowledge and other tomcat related document and experts
response it’s states we need tomcat port need to shuts down for
windows.
Read all the responses; you do *not* need the shutdown port in Windows. If
running Tomcat as a service, the shutdown works with the port set to -1 by
generating a shutdown signal to the Tomcat process. If running Tomcat from
a command prompt, use CTRL-C to terminate Tomcat cleanly.
I am giving link to the each application on destop and start of
menu once user click the link it point static page and it will
call startup.bat file so each application same line I am giving
link and it will point same startup.bat file.
That's bad; each time the user clicks the link a new instance of Tomcat
will start, all but the first of which will die due to port conflicts.
Sloppy, at best. You should have the links target your own script that
determines whether or not Tomcat is running and starts it only when needed.
Next import point we are not shutdown server because user don’t
want to see the tomcat console so we are just leaving server when
user will restart machine then will system will remove instance
from memory.
That would be a guaranteed reason for me *not* to buy your application.
My question is there any way to set up time to stop the server like
after two or 3 hours?
Configure a lifecycle listener for each webapp; if there's no activity for
any of them over the desired time period, send the shutdown signal.
It's probably easiest for you to leave the shutdown port configured, but
use a different password. Since the user has complete control of the
machine, the user can kill the Tomcat process any time he or she chooses, so
the presence of the shutdown port listener is not really a concern.
- Chuck
THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you received
this in error, please contact the sender and delete the e-mail and its
attachments from all computers.
Caldarale, Charles R
2009-11-14 15:57:04 UTC
Permalink
Subject: Re: Tomcat really need Shutdown port
If you dont configure the shutdown port how will tomcat know
which instance to shutdown if you have configured mulitple
tomcat instances using multiple catalina_bases??
If you don't have a shutdown port you have to send the appropriate kill signal to the pid of interest; the pids, of course, are unique.

- Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.
SRamasamy
2009-11-14 16:09:53 UTC
Permalink
Post by Caldarale, Charles R
That's bad; each time the user clicks the link a new instance of Tomcat
will start, all but the first of which will die due to port conflicts.
Sloppy, at best. You should have the links target your own script that
determines whether or not Tomcat is running and starts it only when needed.
--
Each time user click the link it will try to start tomcat it will show
tomcat the following exception
SEVERE: Error initializing endpoint
java.net.BindException: Address already in use: JVM_Bind:5050

but application running, tomcat contain more than one application and also
corresponding link on desktop if user click the 2nd application on the same
tomcat it will show exception on console but application running. When I
trying to click 3rd application same exception is coming but application is
running. And also we are hiding tomcat console user not able to find
exception.

Please let me know can I able to check through bat file whether server is
stated or not?

Our product beauty is no need admin rights to run the application so we are
not prepare tomcat installer version.
So please let me know if I use tomcat binary version is any other way to
find tomcat instance on machine?
--
View this message in context: http://old.nabble.com/Tomcat-really-need-Shutdown-port-tp26343993p26351308.html
Sent from the Tomcat - User mailing list archive at Nabble.com.
Ziggy
2009-11-14 17:53:10 UTC
Permalink
You can use "netstat -a" to see if the Tomcat port number is listening.
Post by Caldarale, Charles R
Post by Caldarale, Charles R
That's bad; each time the user clicks the link a new instance of Tomcat
will start, all but the first of which will die due to port conflicts.
Sloppy, at best. You should have the links target your own script that
determines whether or not Tomcat is running and starts it only when needed.
--
Each time user click the link it will try to start tomcat it will show
tomcat the following exception
SEVERE: Error initializing endpoint
java.net.BindException: Address already in use: JVM_Bind:5050
but application running, tomcat contain more than one application and also
corresponding link on desktop if user click the 2nd application on the same
tomcat it will show exception on console but application running. When I
trying to click 3rd application same exception is coming but application is
running. And also we are hiding tomcat console user not able to find
exception.
Please let me know can I able to check through bat file whether server is
stated or not?
Our product beauty is no need admin rights to run the application so we are
not prepare tomcat installer version.
So please let me know if I use tomcat binary version is any other way to
find tomcat instance on machine?
--
http://old.nabble.com/Tomcat-really-need-Shutdown-port-tp26343993p26351308.html
Sent from the Tomcat - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
Loading...