From 3c3352be129158e2fff25e8bb7faaaf262d66860 Mon Sep 17 00:00:00 2001 From: Jesse Rosenberger Date: Wed, 12 Oct 2016 10:21:32 +0300 Subject: [PATCH] Don't lower `ulimit` max open files if it's already higher than desired Previously, if the default ulimit was set to a value higher than 16384, it was lowering it. While this doesn't do much for users with default OS settings, those that have modified their ulimit settings will have their settings maintained. --- meteor | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/meteor b/meteor index 86f47df4e7..2c2a757958 100755 --- a/meteor +++ b/meteor @@ -114,10 +114,8 @@ DEV_BUNDLE="$SCRIPT_DIR/dev_bundle" METEOR="$SCRIPT_DIR/tools/index.js" -# Bump our file descriptor ulimit as high as it will go. This is a -# temporary workaround for dependancy watching holding open too many -# files: https://app.asana.com/0/364581412985/472479912325 -if [ "$(ulimit -n)" != "unlimited" ] ; then +# Try higher ulimit maxfiles settings until permitted by the kernel +if [ "$(ulimit -n)" != "unlimited" ] && ! [ "$(ulimit -n)" -gt 16384 ] ; then ulimit -n 16384 > /dev/null 2>&1 || \ ulimit -n 8192 > /dev/null 2>&1 || \ ulimit -n 4096 > /dev/null 2>&1 || \