mkcephfs: fix mon_data check

* check the right path <facepalm>
* behave if the directory doesn't exist at all yet

Fixes: #2922
Signed-off-by: Sage Weil <sage@inktank.com>
This commit is contained in:
Sage Weil 2012-08-14 16:53:18 -07:00
parent a4428bd0e1
commit 24a26c6274

View File

@ -266,8 +266,8 @@ if [ -n "$initdaemon" ]; then
fi
if [ $type = "mon" ]; then
get_conf mon_data "/var/run/ceph/mon/ceph-$id" "mon data"
if ! find "$mon_data" -maxdepth 0 -empty | read; 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; 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