Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have Tomcat set up to launch at start up on my Ubuntu box. Trouble is, I have to manually supply a root password on each boot. Is it possible for this to be automated? Do I just supply an command parm? If so, what is the syntax? Thank you!

share|improve this question
add comment

1 Answer 1

up vote 3 down vote accepted

I'm unsure about how you have pulled this off, but it does sound like you have tomcat start up when you login rather than when the machine boots. Am i right?

Anyway, you should have it start when it boots. The following procedures should be done as root. When in use, init will do them as root.

The quick and dirty way:

Given that your start script is "/usr/local/tomcat/bin/startup.sh" the just add that line to the file /etc/rc.local and reboot.

The right way:

Make an upstart script. I haven't really done that before, but I saw this: https://gist.github.com/2924017 which might work. Put the file (tomcat.conf) in /etc/init/ and reboot.

As a service, you can start, stop, restart and get status on services by doing:

start tomcat
stop tomcat
restart tomcat
status tomcat

This is of course how all services in Ubuntu behave. (gdm, apache, ssh, etc..)

Hope it helps :)

share|improve this answer
    
Yes. I simply put it (command line statement) in the Startup Applications list. It launches Tomcat provided I type in the root password quickly. Many times, I don't type it fast enough and have to launch it from the terminal. –  Android Addict Aug 21 '12 at 22:10
    
Remove it from startup applications and follow either of the two solutions. The most stable will be "The right way" while the fastest is probably adding a line to /etc/rc.local. –  Sylwester Aug 21 '12 at 22:14
    
Thank you!!! I am by no measure a sys admin. I followed your advice and it works great - again thank you!!! –  Android Addict Aug 21 '12 at 22:19
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.