Index: bin/catalina.sh =================================================================== --- bin/catalina.sh (revision 1745397) +++ bin/catalina.sh (working copy) @@ -93,6 +93,11 @@ # LOGGING_MANAGER="-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager" # # UMASK (Optional) Override Tomcat's default UMASK of 0027 +# +# USE_NOHUP (Optional) If set to the string true the start command will +# use nohup so that the Tomcat process will ignore any hangup +# signals. Default is "false" unless running on HP-UX in which +# case the default is "true" # ----------------------------------------------------------------------------- # OS specific support. $var _must_ be set to either true or false. @@ -99,10 +104,12 @@ cygwin=false darwin=false os400=false +hpux=false case "`uname`" in CYGWIN*) cygwin=true;; Darwin*) darwin=true;; OS400*) os400=true;; +HP-UX*) hpux=true;; esac # resolve links - $0 may be a softlink @@ -257,6 +264,17 @@ # org.apache.catalina.security.SecurityListener #JAVA_OPTS="$JAVA_OPTS -Dorg.apache.catalina.security.SecurityListener.UMASK=`umask`" +if [ -z "$USE_NOHUP" ]; then + if $hpux; then + USE_NOHUP="true" + else + USE_NOHUP="false" + fi +fi +if [ "$USE_NOHUP" = "true" ]; then + _NOHUP=nohup +fi + # ----- Execute The Requested Command ----------------------------------------- # Bugzilla 37848: only output this if we have a TTY @@ -397,7 +415,7 @@ echo "Using Security Manager" fi shift - eval "\"$_RUNJAVA\"" "\"$LOGGING_CONFIG\"" $LOGGING_MANAGER $JAVA_OPTS $CATALINA_OPTS \ + eval $_NOHUP "\"$_RUNJAVA\"" "\"$LOGGING_CONFIG\"" $LOGGING_MANAGER $JAVA_OPTS $CATALINA_OPTS \ -classpath "\"$CLASSPATH\"" \ -Djava.security.manager \ -Djava.security.policy=="\"$CATALINA_BASE/conf/catalina.policy\"" \ @@ -408,7 +426,7 @@ >> "$CATALINA_OUT" 2>&1 "&" else - eval "\"$_RUNJAVA\"" "\"$LOGGING_CONFIG\"" $LOGGING_MANAGER $JAVA_OPTS $CATALINA_OPTS \ + eval $_NOHUP "\"$_RUNJAVA\"" "\"$LOGGING_CONFIG\"" $LOGGING_MANAGER $JAVA_OPTS $CATALINA_OPTS \ -classpath "\"$CLASSPATH\"" \ -Dcatalina.base="\"$CATALINA_BASE\"" \ -Dcatalina.home="\"$CATALINA_HOME\"" \