• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Bear Bibeault
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • salvin francis
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Frits Walraven
Bartenders:
  • Jj Roberts
  • Carey Brown
  • Scott Selikoff

Automatically start the tomcat services

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Experts,

i have tomcat installed in my server SunOS 5.10 Generic_148888-01 sun4v sparc sun4v.

i am looking your help to implement -
whenever my tomcat service go down it will automatically get started after sometime say after 15 min.

i checked the various option like crontab for user, but i got to know that we can achieve this in the tomcat configuration itself.
also i can't go ahead with the crontab because of the approval process involves in editing crontab -e.
can you please help me in what configuration i need to do in tomcat itself.

Thanks in advance!

Best Regards,
Yuva
 
Saloon Keeper
Posts: 23279
158
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No, Tomcat does not come with any support for setting a poll/restart interval.

Tomcat isn't supposed to "go down" by itself. If it does, that means that either Tomcat was set up sloppy or - and this is more common - webapps were designed sloppy. In the rare case that Tomcat dies because the JVM crashes, someone should determine what's going on and fix it. Usually a different JVM verson will solve that, since JVMs aren't supposed to crash either.

If Tomcat is restarting itself after 15 minutes then somewhere, somehow, there's already something out in your shop's infrastructure that's doing that. Either it's a cron task or some sort of monitoring and control system such as CA-Unicenter or Nagios.

So, first: determine why Tomcat is crashing. Fix it.

Secondly, find out what mechanism is restarting Tomcat and adjust that, if necessary.

Tomcat is not a toy. If you have to go through some sort of change control process to get it fixed, do so.
 
Tom Cook
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Tim,

Thank you for the response.
may be i was not clear it the earlier communication, i do not find it crashing in my env.

just wanted to add this functionality in my tomcat configuration.
if that is possible.

Best Regards,
Yuva
 
Tim Holloway
Saloon Keeper
Posts: 23279
158
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry. That's outside of Tomcat's remit.

Personally, I get a little nervous when servers restart themselves before I know that they've gone down. There's always the chance that the recovery process won't clean up properly and could therefore make the problem worse.
 
Tom Cook
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

now this additional functionality became mandatory for me.
Customer wants this functionality to be implemented.

actually is are one server - SunOS 5.10 Generic_148888-01 sun4v sparc sun4v

two tomcat 6.0 and 8.0 are available in this system.
if i stop the service for tomcat 6.0, it is starting automatically after sometime.
i have to do it for same for tomcat 8.0.

i checked the crontab -l , it is empty. so i am confused.
where can i verify the setting for 6.0. any pointer will be helpful.

Thanks,
Tom
 
Tim Holloway
Saloon Keeper
Posts: 23279
158
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As I said, Tomcat has absolutely no auto-restart capabilities at all, cron or no cron. Whatever is doing your restarting isn't Tomcat.

You might check the /etc/crontab file and its relatives in /etc/cron.xxx directories and see if there's something set up there. System-level control often is done that way rather than as a "crontab -e" function. It's easier to administrate.
 
Tom Cook
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Tim,

Thank you for the help.
i created a shell script (attached).

then i have modified the crontab for the particular user who is responsible for to start the services related to tomcat.
to check it for every 5 min.

no need of root level access.

Thanks,
Brijendra
 
reply
    Bookmark Topic Watch Topic
  • New Topic