From d6ffa770784f0efb88827ee7c65ff2e5f9029434 Mon Sep 17 00:00:00 2001 From: Nathan Cutler Date: Mon, 22 Aug 2016 11:52:45 +0200 Subject: [PATCH] ceph-osd-prestart.sh: check existence of OSD data directory Fixes: http://tracker.ceph.com/issues/17091 Signed-off-by: Nathan Cutler --- src/ceph-osd-prestart.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/ceph-osd-prestart.sh b/src/ceph-osd-prestart.sh index ea6666540bb..2e45724299c 100644 --- a/src/ceph-osd-prestart.sh +++ b/src/ceph-osd-prestart.sh @@ -18,6 +18,13 @@ if [ -z "$id" ]; then fi data="/var/lib/ceph/osd/${cluster:-ceph}-$id" + +# assert data directory exists - see http://tracker.ceph.com/issues/17091 +if [ ! -d "$data" ]; then + echo "OSD data directory $data does not exist; bailing out." 1>&2 + exit 1 +fi + journal="$data/journal" if [ -L "$journal" -a ! -e "$journal" ]; then