tomcat startup script not working at boot

Nils Kassube kassube at gmx.net
Sat Feb 26 17:33:23 UTC 2011


Tapas Mishra wrote:
> On Sat, Feb 26, 2011 at 4:29 PM, Nils Kassube <kassube at gmx.net> wrote:
> > What do you mean with "when I a user logs in to run level 5"?
> > Again, you didn't mention how you switch to runlevel 5.
> 
> No not manually I am referring to bootstrapping.When you switch the
> power button on and from there the
> Ubuntu boot sequence takes over after after the kernel initialized
> and passes on the control to init 5.So
> that the user gets gnome screen.I am not doing any thing manually
> just referring to daemons.

But then you have changed the setup somewhere. Ubuntu goes to runlevel 2 
to start GDM. OTOH, runlevels 2 to 5 are the same, so you would get GDM 
with runlevel 5 as well but runlevel 5 isn't used normally.

> >And as I understand this thread, that is
> >
> > what you want to do. If you really want to include /etc/bash.bashrc
> > in your init script you can do it with a line
> > 
> > . /etc/bash.bashrc
> > somewhere in your script before you need the variables set by
> > /etc/bash.bashrc. However I'd rather copy the needed lines from
> > that file to your init script.
> 
> Ok.So you mean to say these variables in /etc/bash.bashrc come only
> to picture when
> daemons have started all (your boot sequence finished) and you got a
> console to login and not when the daemons are starting  at boot time.

Yes, correct. The daemons are started by the scripts in /etc/init.d 
invoked by the upstart init process without any login shell. And as the 
file /etc/bash.bashrc is only for login shells the startup scripts don't 
use it and can't see any environment variables you put into that file. I 
can't help you with your tomcat script but maybe someone lese knows 
where $JAVA_HOME is usually set for tomcat. At least I wouldn't expect 
it to come from /etc/bash.bashrc.


Nils




More information about the ubuntu-users mailing list