commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject svn commit: r1132660 - in /commons/proper/daemon/trunk: RELEASE-NOTES.txt src/samples/Tomcat7.sh
Date Mon, 06 Jun 2011 14:44:02 GMT
Author: mturk
Date: Mon Jun  6 14:44:01 2011
New Revision: 1132660

URL: http://svn.apache.org/viewvc?rev=1132660&view=rev
Log:
DAEMON-192 Add example of setting ulimit

Modified:
    commons/proper/daemon/trunk/RELEASE-NOTES.txt
    commons/proper/daemon/trunk/src/samples/Tomcat7.sh

Modified: commons/proper/daemon/trunk/RELEASE-NOTES.txt
URL: http://svn.apache.org/viewvc/commons/proper/daemon/trunk/RELEASE-NOTES.txt?rev=1132660&r1=1132659&r2=1132660&view=diff
==============================================================================
--- commons/proper/daemon/trunk/RELEASE-NOTES.txt (original)
+++ commons/proper/daemon/trunk/RELEASE-NOTES.txt Mon Jun  6 14:44:01 2011
@@ -74,6 +74,7 @@ NEW FEATURES:
 BUG FIXES:
 
 1.0.6: DAEMON-186, DAEMON-193, DAEMON-194, DAEMON-206, DAEMON-185, DAEMON-200
+       DAEMON-192
 
 1.0.5: DAEMON-158, DAEMON-184, DAEMON-187, DAEMON-188, DAEMON-190
 

Modified: commons/proper/daemon/trunk/src/samples/Tomcat7.sh
URL: http://svn.apache.org/viewvc/commons/proper/daemon/trunk/src/samples/Tomcat7.sh?rev=1132660&r1=1132659&r2=1132660&view=diff
==============================================================================
--- commons/proper/daemon/trunk/src/samples/Tomcat7.sh (original)
+++ commons/proper/daemon/trunk/src/samples/Tomcat7.sh Mon Jun  6 14:44:01 2011
@@ -61,7 +61,20 @@ do
     ;;
   esac
 done
+# OS specific support (must be 'true' or 'false').
+cygwin=false;
+darwin=false;
+case "`uname`" in
+    CYGWIN*)
+        cygwin=true
+        ;;
+    Darwin*)
+        darwin=true
+        ;;
+esac
 
+# Use the maximum available, or set MAX_FD != -1 to use that
+test ".$MAX_FD" = . && MAX_FD="maximum"
 # Setup parameters for running the jsvc
 #
 test ".$TOMCAT_USER" = . && TOMCAT_USER=tomcat
@@ -124,6 +137,24 @@ JAVA_OPTS="$JAVA_OPTS $LOGGING_MANAGER"
 # Set -pidfile
 test ".$CATALINA_PID" = . && CATALINA_PID="$CATALINA_BASE/logs/catalina-daemon.pid"
 
+# Increase the maximum file descriptors if we can
+if [ "$cygwin" = "false" ]; then
+    MAX_FD_LIMIT=`ulimit -H -n`
+    if [ "$?" -eq 0 ]; then
+        # Darwin does not allow RLIMIT_INFINITY on file soft limit
+        if [ "$darwin" = "true" -a "$MAX_FD_LIMIT" = "unlimited" ]; then
+            MAX_FD_LIMIT=`/usr/sbin/sysctl -n kern.maxfilesperproc`
+        fi
+        test ".$MAX_FD" = "maximum" && MAX_FD="$MAX_FD_LIMIT"
+        ulimit -n $MAX_FD
+        if [ "$?" -ne 0 ]; then
+            echo "$PROGRAM: Could not set maximum file descriptor limit: $MAX_FD"
+        fi
+    else
+        echo "$PROGRAM: Could not query system maximum file descriptor limit: $MAX_FD_LIMIT"
+    fi
+fi
+
 # ----- Execute The Requested Command -----------------------------------------
 case "$1" in
     run     )



Mime
View raw message