Permalink
Browse files

setting a configurable: ULIMIT_N. useful when run as non-root user.

  • Loading branch information...
1 parent f53aac0 commit 669060029ef6c2beb3e2032601aac5a255969e05 Naresh V committed Mar 18, 2011
Showing with 10 additions and 0 deletions.
  1. +10 −0 service/elasticsearch
View
@@ -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"

0 comments on commit 6690600

Please sign in to comment.