From: Dan Mick Date: Tue, 29 Jan 2013 23:18:53 +0000 (-0800) Subject: init-ceph: make ulimit -n be part of daemon command X-Git-Tag: v0.57~77^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=84a024b647c0ac2ee5a91bacdd4b8c966e44175c;p=ceph.git 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//limits on local and remote hosts Fixes: #3900 Signed-off-by: Dan Mick Reviewed-by: Loïc Dachary Reviewed-by: Gary Lowell --- diff --git a/src/init-ceph.in b/src/init-ceph.in index c15a0c40aae4..f7b85b131e81 100644 --- a/src/init-ceph.in +++ b/src/init-ceph.in @@ -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"