]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mkcephfs: create mon data dir prior to ceph-mon --mkfs
authorSage Weil <sage@inktank.com>
Sat, 23 Feb 2013 00:24:18 +0000 (16:24 -0800)
committerSage Weil <sage@inktank.com>
Sat, 23 Feb 2013 00:24:23 +0000 (16:24 -0800)
ceph-mon now expects this directory to already exist.

Signed-off-by: Sage Weil <sage@inktank.com>
src/mkcephfs.in

index 446d56872e85f7c5a62c5cc1f7a8c7e1ed93f9ef..9c01cb0f0a6fcd08bc9629462b134129029cd403 100644 (file)
@@ -267,7 +267,8 @@ if [ -n "$initdaemon" ]; then
 
     if [ $type = "mon" ]; then
        get_conf mon_data "/var/lib/ceph/mon/ceph-$id" "mon data"
-       if test -d $mon_data && ! find "$mon_data" -maxdepth 0 -empty | read foo; then
+       mkdir -p "$mon_data"
+       if ! find "$mon_data" -maxdepth 0 -empty | read foo; then
            echo "ERROR: $name mon_data directory $mon_data is not empty."
            echo "       Please make sure that it is empty before running mkcephfs."
            exit 1