tomcat-users mailing list archives

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

Konstantin Kolinko wrote:
> Note that calling and  is just a wrapper for
> calling with arguments "start" and "stop" respectively.
> I'd recommend co call 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 " run
> -security", so that Tomcat starts interactively in the same shell.

I tried changing it to this:

/bin/su -- tomcat $CATALINA_HOME/bin/ 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

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 didn't seem to indicate any differences
when running as root versus sudo.

Thanks everyone for your replies.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message