views:

311

answers:

2

I tried two ways:

  1. Add the following in etc/rc.local:

    export JAVA_HOME=/home/phoenies/jdk1.6.0_17
    export JRE_HOME=/home/phoenies/jdk1.6.0_17/jre
    export CLASSPATH=.:/home/phoenies/jdk1.6.0_17/lib/*
    /home/phoenies/scarab-0.21/tomcat/bin/startup.sh

  2. Run this:

    ln -s -t /etc/init.d /home/phoenies/scarab-0.21/tomcat/bin/startup.sh
    mv /etc/init.d/startup.sh /etc/init.d/tomcat
    update-rc.d tomcat defaults 99

Neither worked. I've made sure all scripts have the permission to run. I've checked with sysv-rc-conf that rc.local and tomcat would run in runlevels 2-5. And I can startup tomcat manually by double-clicking either of them. Anyone knows why tomcat still doesn't autostart?

My OS is Ubuntu 9.04, Tomcat 4.1 is included in Scarab 0.21 as you can see.

Edit: I've just checked all runlevels in sysv-rc-conf, and this time it worked! I'm not familiar with the concept runlevel. Would someone kindly explain what runlevel my OS is running on? And what are other runlevels for? Thanks.

Reedit: runlevel told me the current runlevel is 2. I don't understand... :(

A: 

Most likely, startup.sh doesn't have executable bit set.

chmod +x startup.sh

I have seen this issue with at least couple of software packages which bundle Tomcat.

Chandra Patni
A: 

Runlevels are to start different things at different points in the start sequence.
You can also use them as a sort of partial reboot.

Tradiationally they are:

  1. Single-User mode
  2. Multi-user mode console logins only (without networking)
  3. Multi-User mode, console logins
  4. Not used
  5. Multi-User mode, with display
  6. Reboot

and 0 = halt (but SO's list wont do 0 because Jeff doesn't know 'C' )

For ubuntu/debian based Linux they aren't used as much, the system always runs in 2. the startup is handled by a program called 'startup'

Martin Beckett