Thanks Chris for answering all the questions!

-----Original Message-----
From: Christopher Schultz [mailto:ch...@christopherschultz.net] 
Sent: Friday, March 07, 2014 3:36 PM
To: Tomcat Users List
Subject: Re: Tomcat 7.0.52 stops after hours on our Sun Sparc with SunOS 5.10

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Jay,

On 3/7/14, 1:46 PM, Jay wrote:
> Tomcat instance launches its background processes which seems to 
> detached from the console/terminal (Please correct if it is not right 
> phrase.)

Here is the misunderstanding: Tomcat's scripts launch Tomcat in the 
"background", but it does not disconnect from the terminal. When you kill the 
terminal (i.e. log out), a signal is sent to all processes bound to the 
terminal that says "terminal hung up" -- that's why its called SIGHUP "Hang UP" 
from the old days when terminals were things like telephone lines that could be 
off-hook on on-hook.

When the JVM receives this process on Solaris (and not all Solarises, not all 
versions, not all configurations), the JVM quits.

Using "nohup" does in fact divorce the JVM from the terminal so that when the 
terminal exits (because you logged-out), the SIGHUP does not kill the JVM.

> As normally, those backend processes keep alive event the user logout 
> or disconnect from the console/terminal where the Tomcat instance was 
> launched. (this was what I meant)

"Normal" for you is abnormal for others. Solaris is a very old time-sharing 
system and the SIGHUP thing was designed to kill processes when the remote user 
went-away. If you want them to not to die, you have to explicitly use "nohup". 
I'm sorry that this is the case on your system, but apparently, its required.

There's nothing the Tomcat team can do to change this.

> Actually, we start Tomcat just using ./startup.sh on Linux the same 
> way as we started it on this SunOS and it never stops on Linux unless 
> stopping it using shutdown.

Different environment. Different kernel. Different userspace.
Different shell. Different everything. Ever heard the term "GNU's Not UNIX"? 
Well, guess what? Solaris /is/ UNIX, and GNU/Linux isn't that.
They may smell the same, but they are very different.

> As we know many people also start the Tomcat as this way on their 
> Linux and Solaris machines without this issue.

Ev-e-ry siiiiiiistem's different, er-e-ry siiiiiiiiistem's goooood. If a 
system's wasted, in your neighborhood...

> Questions: 1. As Tomcat gives a message of "A valid shutdown command 
> was received via the shutdown port." in the log when it receives the 
> signal from a Shutdown command. What message can we see in the log 
> when the Tomcat receives the SIGHUP and/or SIGTERM, etc. that stops 
> the Tomcat?

Tomcat cannot receive the signal, only the JVM can. You'll see that the 
connectors are shut down gracefully, etc. and the server stops.
So, basically, exactly what you have already observed.

> 2. When Tomcat receives the SIGHUP and/or SIGTERM, will Tomcat stop 
> immediately or Tomcat would stop itself after a half day or several 
> days randomly?

Tomcat will shut down as fast as it can. So, immediately.

> 3. If there are multiple users connected to the Solaris with the 
> consoles/terminals, would the Tomcat receives the SIGHUP and/or 
> SIGTERM when any of user logs out and/or disconnected from the 
> Solaris?

It should only be tied to the terminal that was used to launch it.
But, Solaris might have complicated rules for parent-process inheritance when a 
process's parent dies. It may be re-inherited several times before it's 
eventually killed.

> 4. Will the Solaris send the SIGHUP and/or SIGTERM to the Tomcat 
> immediately just the user logged out and/or terminated from the 
> Solaris? or Solaris would wait and then sent the SIGHUP and/or SIGTERM 
> to the Tomcat after a half day or several days randomly?

It should happen immediately.

You should really be asking your administrator about this. We are not Solaris 
experts.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJTGi26AAoJEBzwKT+lPKRY8wEP/RDHlc0KHIAFeS3Za5kPODBv
BUOm75wt96sDDFok0qITPV7WDp3Mstb8mnz0Be6+0TONpx6CPqXj4LtfD7aR/Bas
BdTJWPuaXUeOE+BoejCl23+jADCwHccE1S3KJE5nno8TZ7yjDWxV6BN3krkyY6Bk
wV52ITPWM56Uecyzz2voXDgsypS6WUIAHPHOkAJNMsumDQnTaQZqTDJZ0f1s0YVD
9VXcQ6CqGquijw81PhcA4f64U9gb0+cBxupKayl2Sx6sGSlw9F/3QrM88iMBEuY3
xNm/g9bBKzxjMyDDAuhU67fP2HeUNDzpeWn6ZpNOTQ7kar+wyyqDcKaaOxPb1CQ7
ef7Zb/o0355syi2l7JT5V7FNp3HxXMkFxtQRVvXLEh4kKw0c4RMV+iz3Vf5pWvQL
9pffQHBu1p1lUZk5vvMqxyGN/d6GRahwMQMImuTK52GOW0VK5J9TkGthEbg4UIXE
uwL5Z+nCbMGYVT+Zheij6Uq4WyDpyyoy7WHF3JSzhw0I64TOXEnH1MTwmjQ6orgt
qyd9tShHnk/gTGOEBvvGZuikbPTMt2WAZW95UEIXMUaLupqAz+NLcAepvNYfpUpB
NSJNf4meCwdBydVeZ1WHXRxn5ADDgR3dPpP5IdZf1dBZ8lBQP4Wo+RC8/TKBGhsn
jE7p9Y1RounMVJk1TSdL
=ykQx
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to