tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shaw, Ray V CTR (US)" <ray.v.shaw....@mail.mil>
Subject RE: Issue with sudo + init script
Date Fri, 03 Aug 2012 19:38:12 GMT

Konstantin Kolinko wrote:
> Note that calling startup.sh and shutdown.sh  is just a wrapper for
> calling catalina.sh with arguments "start" and "stop" respectively.
> I'd recommend co call catalina.sh directly instead of those wrapper
> scripts.
>
> Either java fails to start (and catalina.out is opened by shell as the
> output stream of that process - it has nothing to do with Tomcat
> itself),  or it terminates when its parent process terminates due to
> HUP signal.
>
> To exclude the former, try replace your command with "catalina.sh run
> -security", so that Tomcat starts interactively in the same shell.

I tried changing it to this:

/bin/su -- tomcat $CATALINA_HOME/bin/catalina.sh run -security

(as well as various permutations with the quotes remaining).  I also put an export before
CATALINA_HOME, and have tried putting quotes around the stop command (to no effect); all together,
this should address the issues André Warnier raised.

When I use "run", it works correctly from sudo, but stays attached to the terminal (and I
can't seem to find any combination of nohup, exec, and/or & that will start it detached;
I can use ctrl-z and bg, but that's ugly).  When I use "start", I get the same issue as before.

As requested by Stefan Mayr, the output (normally) is this (exactly the same for root and
sudo):

bash-4.1# service tomcat7 start
DES encrypted or local terminal session
Using CATALINA_BASE:   /opt/tomcat7
Using CATALINA_HOME:   /opt/tomcat7
Using CATALINA_TMPDIR: /opt/tomcat7/temp
Using JRE_HOME:        /usr/java/jdk6-64/
Using CLASSPATH:       /opt/tomcat7/bin/bootstrap.jar:/opt/tomcat7/bin/tomcat-juli.jar
Using Security Manager

Adding a -x to the /bin/sh at the top of catalina.sh didn't seem to indicate any differences
when running as root versus sudo.

Thanks everyone for your replies.

--Ray
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message