Repository: karaf Updated Branches: refs/heads/karaf-2.3.x c2f88df27 -> 267168927
[KARAF-3996] Update karaf script to be able to use custom MAX_FD Project: http://git-wip-us.apache.org/repos/asf/karaf/repo Commit: http://git-wip-us.apache.org/repos/asf/karaf/commit/26716892 Tree: http://git-wip-us.apache.org/repos/asf/karaf/tree/26716892 Diff: http://git-wip-us.apache.org/repos/asf/karaf/diff/26716892 Branch: refs/heads/karaf-2.3.x Commit: 267168927ec97651979624e88fcc4ff84c045db2 Parents: c2f88df Author: Jean-Baptiste Onofré <[email protected]> Authored: Fri Sep 25 07:54:10 2015 +0200 Committer: Jean-Baptiste Onofré <[email protected]> Committed: Fri Sep 25 07:54:10 2015 +0200 ---------------------------------------------------------------------- .../src/main/distribution/unix-shell/bin/karaf | 24 +++++++++----------- 1 file changed, 11 insertions(+), 13 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/karaf/blob/26716892/assemblies/apache-karaf/src/main/distribution/unix-shell/bin/karaf ---------------------------------------------------------------------- diff --git a/assemblies/apache-karaf/src/main/distribution/unix-shell/bin/karaf b/assemblies/apache-karaf/src/main/distribution/unix-shell/bin/karaf index 5e88b08..a672c31 100755 --- a/assemblies/apache-karaf/src/main/distribution/unix-shell/bin/karaf +++ b/assemblies/apache-karaf/src/main/distribution/unix-shell/bin/karaf @@ -91,24 +91,22 @@ unlimitFD() { # Increase the maximum file descriptors if we can if [ "$os400" = "false" ] && [ "$cygwin" = "false" ]; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ "$MAX_FD_LIMIT" != 'unlimited' ]; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ]; then + MAX_FD_LIMIT=`ulimit -H -n` if [ $? -eq 0 ]; then - if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ]; then - # use the system max - MAX_FD="$MAX_FD_LIMIT" - fi - - ulimit -n $MAX_FD > /dev/null - # echo "ulimit -n" `ulimit -n` - if [ $? -ne 0 ]; then - warn "Could not set maximum file descriptor limit: $MAX_FD" - fi + # use the system max + MAX_FD="$MAX_FD_LIMIT" else warn "Could not query system maximum file descriptor limit: $MAX_FD_LIMIT" fi fi - fi + if [ "$MAX_FD" != 'unlimited' ]; then + ulimit -n $MAX_FD > /dev/null + if [ $? -ne 0 ]; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + fi + fi } locateHome() {
