init-ceph: make ulimit -n be part of daemon command

ulimit -n from 'max open files' was being set only on the machine
running /etc/init.d/ceph.  It needs to be added to the commands to
start the daemons, and run both locally and remotely.

Verified by examining /proc/<pid>/limits on local and remote hosts

Fixes: #3900
Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Loïc Dachary <loic@dachary.org>
Reviewed-by: Gary Lowell <gary.lowell@inktank.com>
This commit is contained in:
Dan Mick 2013-01-29 15:18:53 -08:00
parent f41010c44b
commit 84a024b647

View File

@ -245,14 +245,6 @@ for name in $what; do
start)
# Increase max_open_files, if the configuration calls for it.
get_conf max_open_files "8192" "max open files"
if [ $max_open_files != "0" ]; then
# Note: Don't try to do math with these numbers, because POSIX shells
# can't do 64-bit math (natively). Just treat them as strings.
cur=`ulimit -n`
if [ "x$max_open_files" != "x$cur" ]; then
ulimit -n $max_open_files
fi
fi
# build final command
wrap=""
@ -266,8 +258,9 @@ for name in $what; do
[ -n "$valgrind" ] && wrap="$wrap valgrind $valgrind"
[ -n "$wrap" ] && runmode="-f &" && runarg="-f"
[ -n "$max_open_files" ] && files="ulimit -n $max_open_files;"
cmd="$wrap $cmd $runmode"
cmd="$files $wrap $cmd $runmode"
if [ $dofsmount -eq 1 ] && [ -n "$fs_devs" ]; then
get_conf pre_mount "true" "pre mount command"