]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
init-ceph: make ulimit -n be part of daemon command
authorDan Mick <dan.mick@inktank.com>
Tue, 29 Jan 2013 23:18:53 +0000 (15:18 -0800)
committerDan Mick <dan.mick@inktank.com>
Wed, 30 Jan 2013 00:48:17 +0000 (16:48 -0800)
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>
src/init-ceph.in

index c15a0c40aae46a0981df84a2c672150444911de9..f7b85b131e81e68cc344b5ac4fe9a10095294893 100644 (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"