]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mkmonfs: require '-c conf' to avoid accidents; stash admin keyring
authorSage Weil <sage@newdream.net>
Thu, 11 Feb 2010 23:31:40 +0000 (15:31 -0800)
committerSage Weil <sage@newdream.net>
Thu, 11 Feb 2010 23:33:10 +0000 (15:33 -0800)
src/mkcephfs.in

index ff23a5618c7e984b8150a05cdd2ee47cb8743a8a..bb07afeeabce8328268459b09466ee7a4aed31f9 100644 (file)
@@ -18,7 +18,8 @@ else
 fi
 
 usage_exit() {
-    echo "usage: $0 [--allhosts] [-c ceph.conf] [--clobber] [--mkbtrfs] [-k adminkeyring]"
+    echo "usage: $0 -c ceph.conf [--clobber] [--allhosts] [--mkbtrfs] [-k adminkeyring]"
+    echo "   ** be careful, this WILL clobber old data; check your ceph.conf carefully **"
     exit
 }
 
@@ -33,6 +34,7 @@ usecrushmapsrc=
 usecrushmap=
 verbose=0
 adminkeyring=""
+conf=""
 
 while [ $# -ge 1 ]; do
 case $1 in
@@ -81,6 +83,8 @@ esac
 shift
 done
 
+[ -z "$conf" ] && usage_exit
+
 verify_conf
 
 get_name_list "$@"
@@ -199,9 +203,9 @@ for name in $what; do
        do_cmd "$BINDIR/mkmonfs $clobber --mon-data $mon_data -i $num --monmap $monmap --osdmap $osdmap -k $tmpkeyring ; rm $tmpkeyring"
 
        if [ -n "$ssh" ]; then
-           scp $adminkeyring $user@$host:$mon_data/admin_keyring.bin
+           scp -p $adminkeyring $user@$host:$mon_data/admin_keyring.bin
        else
-           cp -v $adminkeyring $mon_data/admin_keyring.bin
+           cp -av $adminkeyring $mon_data/admin_keyring.bin
        fi
     fi