3 if [ `uname` = FreeBSD ]; then
4 GETOPT=/usr/local/bin/getopt
9 eval set -- "$(${GETOPT} -o i: --long id:,cluster: -- $@)"
13 -i|--id) id=$2; shift 2 ;;
14 --cluster) cluster=$2; shift 2 ;;
20 echo "Usage: $0 [OPTIONS]"
21 echo "--id/-i ID set ID portion of my name"
22 echo "--cluster NAME set cluster name (default: ceph)"
26 data="/var/lib/ceph/osd/${cluster:-ceph}-$id"
28 # assert data directory exists - see http://tracker.ceph.com/issues/17091
29 if [ ! -d "$data" ]; then
30 echo "OSD data directory $data does not exist; bailing out." 1>&2
34 journal="$data/journal"
36 if [ -L "$journal" -a ! -e "$journal" ]; then
37 udevadm settle --timeout=5 || :
38 if [ -L "$journal" -a ! -e "$journal" ]; then
39 echo "ceph-osd(${cluster:-ceph}-$id): journal not present, not starting yet." 1>&2
44 # ensure ownership is correct
45 owner=`stat -c %U $data/.`
46 if [ $owner != 'ceph' -a $owner != 'root' ]; then
47 echo "ceph-osd data dir $data is not owned by 'ceph' or 'root'"
48 echo "you must 'chown -R ceph:ceph ...' or similar to fix ownership"