• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Tomcat service will only start on user login

 
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've setup tomcat on a CentOS 6.5 and chown'ed the directory as tomcat:tomcat (a valid user on the server). I've placed my startup script in /etc/init.d/tomcat (chmod 755) and I've registered it with chkconfig at level 234, though a --list shows level 5 is also on. We've also disabled SELinux, but tomcat still will only come up when the user account root is logged into. The only thing I can think of is that I did all of this as the root user, not as the tomcat user using sudo. Would that be the cause of my problem, or am I missing something else.
 
Ranch Hand
Posts: 426
Eclipse IDE Fedora Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can you post your startup files ? Are you having init.d invoke CATALINA_HOME/bin/startup.sh ? Do you enable the tomcat user in rc.ini/rc.conf (in /etc)? Exactly what is the chkconfig command you are running ? What script does it point to ? Need more info ... specific code posted that comprise the contents of your scripts. TellTheDetails .
 
Matthew Snow
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the reply. Below is my /etc/init.d/tomcat script. This script is invoking CATALINA_HOME/bin/catalina.sh. I did not enable the tomcat user in rc.conf, file does not exist on CentOS 6.5, or at least I can't find it. The chkconfig commands I used were "chkconfig --add /etc/init.d/tomcat" and "chkconfig --level 234 /etc/init.d/tomcat on".

 
Saloon Keeper
Posts: 25482
180
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
My best guess is that you haven't paid attention to the startup order of the system services. If you attempt to start Tomcat before the network services, for example, it will fail. Or at least be useless, since the running Tomcat wouldn't have been able to open its listener ports.

If you're using the chkconfig command to enable Tomcat service, you should add something like this to the top of it:



The "chkconfig" line indicates what init levels Tomcat runs under (3, 4, and 5) and that its startup and shutdown priorities are. You want those numbers to be after the network, but before Apache coming up and the reverse going down.

Level 3 is the lowest level that has network services, level 5 is with the GUI enabled, and actually at the moment, I don't think people use level 4, but no harm in allowing for it.

To get these settings to take:



And you might have to manually remove the old level priority aliases from the rc3.d, rc4.d and rc5.d directories.

You might want to confirm that CentOS 6.5 still uses init scripts. I'm pretty sure all CentOS 6 versions do, but since the Red Hat world is migrating to the newer systemctl manager, there could be a problem there.
 
Slideshow boring ... losing consciousness ... just gonna take a quick nap on this tiny ad ...
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic