Author: markt
Date: Sun Jun 5 18:55:33 2016
New Revision: 1746939
URL: http://svn.apache.org/viewvc?rev=1746939&view=rev
Log:
Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=58626
Add support for a new environment variable (USE_NOHUP) that causes nohup to be
used when starting Tomcat. It is disabled by default except on HP-UX where it
is enabled by default since it is required when starting Tomcat at boot on
HP-UX.
Modified:
tomcat/trunk/bin/catalina.sh
tomcat/trunk/webapps/docs/changelog.xml
Modified: tomcat/trunk/bin/catalina.sh
URL:
http://svn.apache.org/viewvc/tomcat/trunk/bin/catalina.sh?rev=1746939&r1=1746938&r2=1746939&view=diff
==============================================================================
--- tomcat/trunk/bin/catalina.sh (original)
+++ tomcat/trunk/bin/catalina.sh Sun Jun 5 18:55:33 2016
@@ -93,16 +93,23 @@
#
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.
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,18 @@ umask $UMASK
# 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
+unset _NOHUP
+if [ "$USE_NOHUP" = "true" ]; then
+ _NOHUP=nohup
+fi
+
# ----- Execute The Requested Command -----------------------------------------
# Bugzilla 37848: only output this if we have a TTY
@@ -397,7 +416,7 @@ elif [ "$1" = "start" ] ; then
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 +427,7 @@ elif [ "$1" = "start" ] ; then
>> "$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\"" \
Modified: tomcat/trunk/webapps/docs/changelog.xml
URL:
http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1746939&r1=1746938&r2=1746939&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/trunk/webapps/docs/changelog.xml Sun Jun 5 18:55:33 2016
@@ -175,6 +175,13 @@
<scode>
Use UTF-8 with a standard prolog for all XML files. (markt)
</scode>
+ <fix>
+ <bug>58626</bug>: Add support for a new environment variable
+ (<code>USE_NOHUP</code>) that causes <code>nohup</code> to be used when
+ starting Tomcat. It is disabled by default except on HP-UX where it is
+ enabled by default since it is required when starting Tomcat at boot on
+ HP-UX. (markt)
+ </fix>
</changelog>
</subsection>
</section>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]