X-Git-Url: http://git.pld-linux.org/?a=blobdiff_plain;f=apache-tomcat.init;h=83e5a933d5a962a6c28423ec1874d67e2b9f6484;hb=HEAD;hp=591ad99f5f99c484d6ed3cb42644edec3f8ffa77;hpb=6755b80cf50c22010bde0d3cdf25098408a9ca29;p=packages%2Ftomcat.git diff --git a/apache-tomcat.init b/apache-tomcat.init index 591ad99..83e5a93 100755 --- a/apache-tomcat.init +++ b/apache-tomcat.init @@ -3,11 +3,8 @@ # tomcat Tomcat Servlet/JSP container # # chkconfig: 345 84 16 -# # description: Tomcat Servlet/JSP container # -# $Id$ - # Source function libraries . /etc/rc.d/init.d/functions @@ -19,7 +16,7 @@ # Check that networking is up. if is_yes "${NETWORKING}"; then if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then - msg_network_down tomcat + msg_network_down "Tomcat" exit 1 fi else @@ -61,65 +58,73 @@ fi start() { # Check if the service is already running? - if [ ! -f /var/lock/subsys/tomcat ]; then - msg_starting tomcat - busy - cd $CATALINA_BASE - /usr/bin/jsvc -user tomcat -procname tomcat \ - $JSVC_OPTS \ - -Dcatalina.base=${CATALINA_BASE} \ - -Dcatalina.home=${CATALINA_HOME} \ - -Djava.io.tmpdir=${CATALINA_TMPDIR} \ - -Djava.library.path=/usr/lib64:/usr/lib \ - -Djava.util.logging.config.file="${CATALINA_BASE}/conf/logging.properties" \ - -Djava.util.logging.manager="org.apache.juli.ClassLoaderLogManager" \ - $CATALINA_OPTS \ - org.apache.catalina.startup.Bootstrap >> /var/log/tomcat/catalina.out 2>&1 - [ $? -ne 0 ] && RETVAL=1 - if [ $RETVAL -eq 0 ]; then - ok - touch /var/lock/subsys/tomcat - else - fail - fi + if [ -f /var/lock/subsys/tomcat ]; then + msg_already_running "Tomcat" + return + fi + + msg_starting "Tomcat" + busy + cd $CATALINA_BASE + /usr/bin/jsvc \ + -user tomcat \ + -procname tomcat \ + -wait 360 \ + -outfile /var/log/tomcat/catalina.out \ + -errfile /var/log/tomcat/catalina.out \ + $JSVC_OPTS \ + -Dcatalina.base=${CATALINA_BASE} \ + -Dcatalina.home=${CATALINA_HOME} \ + -Djava.io.tmpdir=${CATALINA_TMPDIR} \ + -Djava.library.path=/usr/lib64:/usr/lib \ + -Djava.util.logging.config.file="${CATALINA_BASE}/conf/logging.properties" \ + -Djava.util.logging.manager="org.apache.juli.ClassLoaderLogManager" \ + $CATALINA_OPTS \ + org.apache.catalina.startup.Bootstrap + [ $? -ne 0 ] && RETVAL=1 + if [ $RETVAL -eq 0 ]; then + ok + touch /var/lock/subsys/tomcat else - msg_already_running tomcat + fail fi } stop() { - if [ -f /var/lock/subsys/tomcat ]; then - # Stop daemons. - msg_stopping tomcat - busy - jsvc -user tomcat -stop \ - $JSVC_OPTS \ - org.apache.catalina.startup.Bootstrap - [ $? -eq 0 ] && ok || fail - rm -f /var/lock/subsys/tomcat - else - msg_not_running tomcat + if [ ! -f /var/lock/subsys/tomcat ]; then + msg_not_running "Tomcat" + return fi + + # Stop daemons. + msg_stopping "Tomcat" + busy + jsvc -user tomcat -stop -wait 360 \ + $JSVC_OPTS \ + org.apache.catalina.startup.Bootstrap + [ $? -eq 0 ] && ok || fail + rm -f /var/lock/subsys/tomcat } condrestart() { - if [ -f /var/lock/subsys/tomcat ]; then - stop - start - else - msg_not_running tomcat + if [ ! -f /var/lock/subsys/tomcat ]; then + msg_not_running "Tomcat" RETVAL=$1 + return fi + + stop + start } RETVAL=0 # See how we were called. case "$1" in start) - start + start ;; stop) - stop + stop ;; restart) stop