tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shaw, Ray V CTR (US)" <>
Subject Issue with sudo + init script
Date Wed, 01 Aug 2012 17:10:50 GMT
I'm starting up Tomcat 7.0 on RHEL6 with the following init script:

# chkconfig: 235 80 20
# description: Takes care of starting and stopping Tomcat.

export JAVA_HOME="/usr/java/jdk6-64/"

case "$1" in
                /bin/su tomcat -c "$CATALINA_HOME/bin/ -security"
                /bin/su tomcat -c $CATALINA_HOME/bin/
                echo "usage: $0 {start|stop}"

If I use sudo -s (or -i) to get a root shell, I can use this script to start and stop Tomcat.

If I invoke this script directly via sudo, i.e. "sudo /sbin/service tomcat7 stop", stopping
Tomcat works.  Starting does not; Tomcat gives the usual output to the terminal, creates or
touches catalina.out (but writes nothing to it), and then instantly exits.  This is a problem,
because I need to allow the Web admin to start/stop Tomcat without giving them everything.

Has anyone seen anything similar to this before?  /var/log/secure isn't showing anything out
of the ordinary (and obviously, the commands are being run).



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

View raw message