Re: STARTUP.SH DOESN'T WORKS FINE
On 22/10/2001 03:54 pm, Nancy Crisostomo Martinez [EMAIL PROTECTED] wrote: Hello everybody! I hope you could help me, please.. Actually, I'm begining to use Tomcat, and I have a succeded start because it still works PERFECT to me... But muy problem is very strange : I installed Tomcat to Solaris 8, and when I start it (startup.sh | tomcat.sh start ) it starts, but when I close the terminal window Tomcat shuts down!!! and now I'm using Tomcat with a terminal window opened with the caution message :DON'T CLOSE, PLEASE... I hope you could help me to fix it. Nancy. Are you starting it from a console or terminal window? How do you close your window? (Issuing exit or just closing the window?) Pier -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: STARTUP.SH DOESN'T WORKS FINE
On 14/11/2001 07:07 pm, Nikola Milutinovic [EMAIL PROTECTED] wrote: Tom Drake wrote: This has nothing to do with tomcat. It is standard unix behavior. When a user logs out, all processes created by that user are killed. No, when a user logs out all processes that are children to that shell instance are sent a HUP signal (Hang UP). A process may choose to ignore that signal. Every well written daemon and server process SHOULD do that (among other things). Unix provides simple way to around this feature. Simply type the following command: nohup tomcat.sh run I use tomcat.sh start instead of tomcat.sh run and so should Nancy. The problem is in Tomcat getting HUP signal, but in loosing a console, I think. In this case all 'console output produced by tomcat will appear in a file called 'nohup.out'. The name nohup comes from the days of flaky dialup connections and is short for 'no hang-up'. It is used to prevent a spurious loss of connection (or hang-up) from stopping a process. Or for instance, I connect to my company, locate a file for download, place it in script, run the script with nohup and disconnect. The download will go on. It must be the window manager, because when I SSH to a Solaris 8 machine, issue the tomcat start and then exit (with exit), tomcat is still up... The shell doesn't send any weird HUP, at least from remote... Pier -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: STARTUP.SH DOESN'T WORKS FINE
Nikola Milutinovic [EMAIL PROTECTED] wrote: Good point. Every well written daemon will do the following: 1. parse input and complain if necessary 2. spawn a child and exit 3. a child will close STDIN, STDOUT, STDERR 4. a child will catch/ignore SIGHUP, SIGTERM, ... 5. a child will spawn a daemon process and exit. Is this possible in Java? I don't thnink Java application can spawn another process, it can spawn a thread. Can it close it's connections to the controlling terminal? Tomcat seams to do it. Can it ignore/catch signals? Sure it's possible :) There's also some code I wrote that does exactly that (CVS repository jakarta-tomcat-service)... Works pretty well under Solaris and MacOS/X 10.0/10.1 Pier -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
RE: STARTUP.SH DOESN'T WORKS FINE
If you want a process to be independant from user connection, disconnection on a Unix boxes (and more generally on any system), you should make it run as a service. For example on Linux, you make it run at init time via script in /etc/rc.d/init.d/. And to be sure your tomcat has nothing to do with user, make it run under low priority profile (it didn't need to be run as root since it didn't open port 80). In my latest RPM for tomcat 3.3 and tomcat 4.0, I make tomcat's run under tomcat and tomcat4 users :) - Henri Gomez ___[_] EMAIL : [EMAIL PROTECTED](. .) PGP KEY : 697ECEDD...oOOo..(_)..oOOo... PGP Fingerprint : 9DF8 1EA8 ED53 2F39 DC9B 904A 364F 80E6 -Original Message- From: Pier Fumagalli [mailto:[EMAIL PROTECTED]] Sent: Thursday, November 15, 2001 11:23 AM To: Tomcat Users List Subject: Re: STARTUP.SH DOESN'T WORKS FINE On 14/11/2001 07:07 pm, Nikola Milutinovic [EMAIL PROTECTED] wrote: Tom Drake wrote: This has nothing to do with tomcat. It is standard unix behavior. When a user logs out, all processes created by that user are killed. No, when a user logs out all processes that are children to that shell instance are sent a HUP signal (Hang UP). A process may choose to ignore that signal. Every well written daemon and server process SHOULD do that (among other things). Unix provides simple way to around this feature. Simply type the following command: nohup tomcat.sh run I use tomcat.sh start instead of tomcat.sh run and so should Nancy. The problem is in Tomcat getting HUP signal, but in loosing a console, I think. In this case all 'console output produced by tomcat will appear in a file called 'nohup.out'. The name nohup comes from the days of flaky dialup connections and is short for 'no hang-up'. It is used to prevent a spurious loss of connection (or hang-up) from stopping a process. Or for instance, I connect to my company, locate a file for download, place it in script, run the script with nohup and disconnect. The download will go on. It must be the window manager, because when I SSH to a Solaris 8 machine, issue the tomcat start and then exit (with exit), tomcat is still up... The shell doesn't send any weird HUP, at least from remote... Pier -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: STARTUP.SH DOESN'T WORKS FINE
Good point. Every well written daemon will do the following: 1. parse input and complain if necessary 2. spawn a child and exit 3. a child will close STDIN, STDOUT, STDERR 4. a child will catch/ignore SIGHUP, SIGTERM, ... 5. a child will spawn a daemon process and exit. Is this possible in Java? I don't thnink Java application can spawn another process, it can spawn a thread. Can it close it's connections to the controlling terminal? Tomcat seams to do it. Can it ignore/catch signals? Sure it's possible :) There's also some code I wrote that does exactly that (CVS repository jakarta-tomcat-service)... Works pretty well under Solaris and MacOS/X 10.0/10.1 I'll look into it, but it is low on my priority list. Still, it's nice to know. Nix.
Re: STARTUP.SH DOESN'T WORKS FINE
If you want a process to be independant from user connection, disconnection on a Unix boxes (and more generally on any system), you should make it run as a service. For example on Linux, you make it run at init time via script in /etc/rc.d/init.d/. And suppose it just blocks or I need to reload it for some reason... I would need to stopt/start it manually from a terminal. I start Tomcat from init.d/ and I can use the same script to start/stop Tomcat any time manually. Nix.
Re: STARTUP.SH DOESN'T WORKS FINE
Hi again! And thank you very much to all of you who had been sending some advice!! I tried to start Tomcat with the following sentence: tomcat.sh start And it didn't work again... I'm going to try with nohup... When I work with the server (Solaris) I open a terminal window and I close it with the exit command. But when I work by a remote connection (from my PC, Windows 98) I open a telnet window and it has the same behavior... I can't close the window (terminal o telnet) because Tomcat shuts down... I don't know why it only happends with Tomcat, because when I start Apache or Jserv as the same way, they are still alive when I close the telnet window... Thank you again! Nancy. Pier Fumagalli wrote: On 22/10/2001 03:54 pm, Nancy Crisostomo Martinez [EMAIL PROTECTED] wrote: Hello everybody! I hope you could help me, please.. Actually, I'm begining to use Tomcat, and I have a succeded start because it still works PERFECT to me... But muy problem is very strange : I installed Tomcat to Solaris 8, and when I start it (startup.sh | tomcat.sh start ) it starts, but when I close the terminal window Tomcat shuts down!!! and now I'm using Tomcat with a terminal window opened with the caution message :DON'T CLOSE, PLEASE... I hope you could help me to fix it. Nancy. Are you starting it from a console or terminal window? How do you close your window? (Issuing exit or just closing the window?) Pier -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: STARTUP.SH DOESN'T WORKS FINE
Hi again! And thank you very much to all of you who had been sending some advice!! I tried to start Tomcat with the following sentence: tomcat.sh start There is no need for with start, it already has in the script. And it didn't work again... I'm going to try with nohup... When I work with the server (Solaris) I open a terminal window and I close it with the exit command. But when I work by a remote connection (from my PC, Windows 98) I open a telnet window and it has the same behavior... I can't close the window (terminal o telnet) because Tomcat shuts down... I don't know why it only happends with Tomcat, because when I start Apache or Jserv as the same way, they are still alive when I close the telnet window... OK, I user SecureCRT. I ssh to my server and issue startup.sh, which in turn runs: ./catalina.sh start -config ${CATALINA_HOME}/conf/server.xml which translates to (setup CLASSPATH) $JAVA_HOME/bin/java $CATALINA_OPTS -classpath $CP \ -Dcatalina.base=$CATALINA_BASE \ -Dcatalina.home=$CATALINA_HOME \ org.apache.catalina.startup.Bootstrap -config ${CATALINA_HOME}/conf/server.xml start So, try a normal telnet client like CRT (I'm not advertizing, just have a lot of good expirience with the CRT/SCRT products) and run just: ./bin/tomcat.sh start -config config/server.xml and logout normally, just like you would do after Apache or Sendmail. You can setup your environment later... Nix. Nix.
Re: STARTUP.SH DOESN'T WORKS FINE
This has nothing to do with tomcat. It is standard unix behavior. When a user logs out, all processes created by that user are killed. Unix provides simple way to around this feature. Simply type the following command: nohup tomcat.sh run In this case all 'console output produced by tomcat will appear in a file called 'nohup.out'. The name nohup comes from the days of flaky dialup connections and is short for 'no hang-up'. It is used to prevent a spurious loss of connection (or hang-up) from stopping a process. - Original Message - From: Nancy Crisostomo Martinez [EMAIL PROTECTED] To: Tomcat_Users [EMAIL PROTECTED] Sent: Monday, October 22, 2001 7:54 AM Subject: STARTUP.SH DOESN'T WORKS FINE | Hello everybody! | I hope you could help me, please.. | | Actually, I'm begining to use Tomcat, and I have a succeded start | because it still works PERFECT to me... | But muy problem is very strange : | I installed Tomcat to Solaris 8, and when I start it (startup.sh | | tomcat.sh start ) it starts, but when I close the terminal window Tomcat | shuts down!!! and now I'm using Tomcat with a terminal window opened | with the caution message :DON'T CLOSE, PLEASE... | | I hope you could help me to fix it. | Nancy. | | | | -- | To unsubscribe: mailto:[EMAIL PROTECTED] | For additional commands: mailto:[EMAIL PROTECTED] | Troubles with the list: mailto:[EMAIL PROTECTED] | | | -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: STARTUP.SH DOESN'T WORKS FINE
Tom Drake wrote: This has nothing to do with tomcat. It is standard unix behavior. When a user logs out, all processes created by that user are killed. No, when a user logs out all processes that are children to that shell instance are sent a HUP signal (Hang UP). A process may choose to ignore that signal. Every well written daemon and server process SHOULD do that (among other things). Unix provides simple way to around this feature. Simply type the following command: nohup tomcat.sh run I use tomcat.sh start instead of tomcat.sh run and so should Nancy. The problem is in Tomcat getting HUP signal, but in loosing a console, I think. In this case all 'console output produced by tomcat will appear in a file called 'nohup.out'. The name nohup comes from the days of flaky dialup connections and is short for 'no hang-up'. It is used to prevent a spurious loss of connection (or hang-up) from stopping a process. Or for instance, I connect to my company, locate a file for download, place it in script, run the script with nohup and disconnect. The download will go on. Nix. -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
RE: STARTUP.SH DOESN'T WORKS FINE
-Original Message- From: Nikola Milutinovic [mailto:[EMAIL PROTECTED]] Sent: Wednesday, November 14, 2001 2:07 PM To: Tomcat Users List Subject: Re: STARTUP.SH DOESN'T WORKS FINE Every well written daemon and server process SHOULD do that (among other things). But you need to remember that you are not running Tomcat, you are running Java - that's a big difference. And it limits what is possible. -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: STARTUP.SH DOESN'T WORKS FINE
- Original Message - From: Nikola Milutinovic [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Wednesday, November 14, 2001 11:07 AM Subject: Re: STARTUP.SH DOESN'T WORKS FINE | Tom Drake wrote: | | This has nothing to do with tomcat. It is standard unix behavior. | When a user logs out, all processes created by that user are killed. | | | No, when a user logs out all processes that are children to that shell instance | are sent a HUP signal (Hang UP). A process may choose to ignore that signal. | Every well written daemon and server process SHOULD do that (among other things). Effectively the process is killed. I think we are saying the same thing. As far as I know, there's no way to receive SIGHUP (or any other Unix signal) in your java code anyway. | | | Unix provides simple way to around this feature. | Simply type the following command: | | nohup tomcat.sh run | | | I use tomcat.sh start instead of tomcat.sh run and so should Nancy. The | problem is in Tomcat getting HUP signal, but in loosing a console, I think. I think that run is actually more appropriate since it will not spawn the jvm in background. We are doing that ourselves with the '' at the end of the command above. | | | In this case all 'console output produced by tomcat will | appear in a file called 'nohup.out'. | | The name nohup comes from the days of flaky dialup connections | and is short for 'no hang-up'. It is used to | prevent a spurious loss of connection (or hang-up) from stopping | a process. | | Or for instance, I connect to my company, locate a file for download, place it | in script, run the script with nohup and disconnect. The download will go on. | | Nix. | | | -- | To unsubscribe: mailto:[EMAIL PROTECTED] | For additional commands: mailto:[EMAIL PROTECTED] | Troubles with the list: mailto:[EMAIL PROTECTED] | | | -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
RE: STARTUP.SH DOESN'T WORKS FINE
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Nancy, Try the following; If you DO NOT want the output from tomcat.sh to go to the file nohup.out nohup tomcat.sh start /dev/null 21 Later! DT The opinions expressed above are probably mine but not necessarily the opinions of my employers. In order to prevent possible injury to yourself, or your computer, and to ensure readability, please do not smoke, eat, drink, spindle, bend, fold, staple, or mutilate this e-mail message. - -Original Message- From: Nancy Crisostomo Martinez [mailto:[EMAIL PROTECTED]] Sent: Monday, October 22, 2001 8:55 AM To: Tomcat_Users Subject: STARTUP.SH DOESN'T WORKS FINE Hello everybody! I hope you could help me, please.. Actually, I'm begining to use Tomcat, and I have a succeded start because it still works PERFECT to me... But muy problem is very strange : I installed Tomcat to Solaris 8, and when I start it (startup.sh | tomcat.sh start ) it starts, but when I close the terminal window Tomcat shuts down!!! and now I'm using Tomcat with a terminal window opened with the caution message :DON'T CLOSE, PLEASE... I hope you could help me to fix it. Nancy. - -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -BEGIN PGP SIGNATURE- Version: PGPfreeware 7.0.3 for non-commercial use http://www.pgp.com iQA/AwUBO/LRcSqKAcOxsM3XEQJugQCgpdTh+4s7R+DF1httL/erEk0qyR4AoLEx h1bSrBotdA+YvhhkYre0NVbF =vMJe -END PGP SIGNATURE- -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: STARTUP.SH DOESN'T WORKS FINE
Hi Nancy, This is what happens under Linux: 1. Switch to a virtual console and login 2. execute startup.sh (Tomcat is running) 3. exit from shell 4. Login and Tomcat is still running. So I have daemon behaviour under Linux. -Janek --- Nancy Crisostomo Martinez [EMAIL PROTECTED] wrote: Hello everybody! I hope you could help me, please.. Actually, I'm begining to use Tomcat, and I have a succeded start because it still works PERFECT to me... But muy problem is very strange : I installed Tomcat to Solaris 8, and when I start it (startup.sh | tomcat.sh start ) it starts, but when I close the terminal window Tomcat shuts down!!! and now I'm using Tomcat with a terminal window opened with the caution message :DON'T CLOSE, PLEASE... I hope you could help me to fix it. Nancy. -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] __ Do You Yahoo!? Everything you'll ever need on one web page from News and Sport to Email and Music Charts http://uk.my.yahoo.com -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: STARTUP.SH DOESN'T WORKS FINE
--- Tom Drake [EMAIL PROTECTED] wrote: Effectively the process is killed. I think we are saying the same thing. As far as I know, there's no way to receive SIGHUP (or any other Unix signal) in your java code anyway. It is possible to register a shutdown hook which is executed when the JVM is shutdown http://developer.java.sun.com/developer/TechTips/2000/tt0711.html JBoss uses this (AFAIK) in order to do an orderly shutdown when ctrl-c in pressed in the console it is running. -Janek __ Do You Yahoo!? Everything you'll ever need on one web page from News and Sport to Email and Music Charts http://uk.my.yahoo.com -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: STARTUP.SH DOESN'T WORKS FINE
Every well written daemon and server process SHOULD do that (among other things). But you need to remember that you are not running Tomcat, you are running Java - that's a big difference. And it limits what is possible. Good point. Every well written daemon will do the following: 1. parse input and complain if necessary 2. spawn a child and exit 3. a child will close STDIN, STDOUT, STDERR 4. a child will catch/ignore SIGHUP, SIGTERM, ... 5. a child will spawn a daemon process and exit. Is this possible in Java? I don't thnink Java application can spawn another process, it can spawn a thread. Can it close it's connections to the controlling terminal? Tomcat seams to do it. Can it ignore/catch signals? Nix.
Re: STARTUP.SH DOESN'T WORKS FINE
| Tom Drake wrote: | | This has nothing to do with tomcat. It is standard unix behavior. | When a user logs out, all processes created by that user are killed. | | | No, when a user logs out all processes that are children to that shell instance | are sent a HUP signal (Hang UP). A process may choose to ignore that signal. | Every well written daemon and server process SHOULD do that (among other things). Effectively the process is killed. I think we are saying the same thing. As far as I know, there's no way to receive SIGHUP (or any other Unix signal) in your java code anyway. I just wanted to be clear. :-) A JVM is a regular UNIX process, I see no reason why it shouldn't be able to close it's controlling terminal. Or ignore loosing one, for that matter. I have started Tomcat from a terminal with catalina.sh start and it shows on ps -A as: 15532 ?? S8:34.29 /usr/opt/java130/bin/alpha/native_threads/java -classpath /usr/local/java/tomcat-4.01/bin/... So, it can survive even without nohup. | I use tomcat.sh start instead of tomcat.sh run and so should Nancy. The | problem is in Tomcat getting HUP signal, but in loosing a console, I think. I think that run is actually more appropriate since it will not spawn the jvm in background. We are doing that ourselves with the '' at the end of the command above. Yes, effectively it will do the same thing as start Nix.