summaryrefslogtreecommitdiff
path: root/debian/init.d
diff options
context:
space:
mode:
authorErnie Hershey <ernie.hershey@10gen.com>2014-02-19 09:13:53 -0500
committerErnie Hershey <ernie.hershey@10gen.com>2014-02-19 13:13:23 -0500
commit637ca318fd8df656931591214fccaf219616fd91 (patch)
treeb1820ba4696908510c8caee65af4e880750e3b5b /debian/init.d
parent05c1dd31bbb2f5e039845031213f1b1f243d598f (diff)
downloadmongo-637ca318fd8df656931591214fccaf219616fd91.tar.gz
SERVER-12346 Detect dash for ulimit parameter in .deb init script
Diffstat (limited to 'debian/init.d')
-rw-r--r--debian/init.d10
1 files changed, 9 insertions, 1 deletions
diff --git a/debian/init.d b/debian/init.d
index ecb2255f75d..417f7f2ee79 100644
--- a/debian/init.d
+++ b/debian/init.d
@@ -128,7 +128,15 @@ start_server() {
ulimit -v unlimited
ulimit -n 64000
ulimit -m unlimited
- ulimit -u 32000
+
+ # In dash, ulimit takes -p for maximum user processes
+ # In bash, it's -u
+ if readlink /proc/$$/exe | grep -q dash
+ then
+ ulimit -p 32000
+ else
+ ulimit -u 32000
+ fi
# Start the process using the wrapper
start-stop-daemon --background --start --quiet --pidfile $PIDFILE \