From 669060029ef6c2beb3e2032601aac5a255969e05 Mon Sep 17 00:00:00 2001 From: Naresh V Date: Fri, 18 Mar 2011 17:13:32 +0530 Subject: [PATCH] setting a configurable: ULIMIT_N. useful when run as non-root user. --- service/elasticsearch | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/service/elasticsearch b/service/elasticsearch index 7f28db0..0c8dae8 100755 --- a/service/elasticsearch +++ b/service/elasticsearch @@ -86,6 +86,10 @@ WAIT_FOR_STARTED_TIMEOUT=120 # port needs to be allocated prior to the user being changed. #RUN_AS_USER= +# Specify the number of open files ulimit for the above user +# recommended value: 32000 +#ULIMIT_N= + # By default we show a detailed usage block. Uncomment to show brief usage. #BRIEF_USAGE=true @@ -556,6 +560,12 @@ checkUser() { shift done + # Set ulimit if specified. + if [ "X$ULIMIT_N" != "X" ] + then + ulimit -n $ULIMIT_N + fi + # Use "runuser" if this exists. runuser should be used on RedHat in preference to su. # if test -f "/sbin/runuser"