diff options
author | Sage Weil <sage@inktank.com> | 2013-07-02 14:43:17 -0700 |
---|---|---|
committer | Sage Weil <sage@inktank.com> | 2013-07-02 14:43:35 -0700 |
commit | 0143acc49bc5834836afc2c5a9d8f67030bec85f (patch) | |
tree | 0001151a791be97d9c8179732d51363a2a31855a | |
parent | 7e878bcc8c1b51538f3c05f854a9dac74c09b116 (diff) | |
download | ceph-0143acc49bc5834836afc2c5a9d8f67030bec85f.tar.gz |
sysvinit, upstart: handle symlinks to dirs in /var/lib/ceph/*
Match a symlink to a dir, not just dirs. This fixes the osd case of e.g.,
creating an osd in /data/osd$id in which ceph-disk makes a symlink from
/var/lib/ceph/osd/ceph-$id.
Fix proposed by Matt Thompson <matt.thompson@mandiant.com>; extended to
include the upstart users too.
Fixes: #5490
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Dan Mick <dan.mick@inktank.com>
(cherry picked from commit 87c98e92d1375c8bc76196bbbf06f677bef95e64)
-rw-r--r-- | src/ceph_common.sh | 2 | ||||
-rw-r--r-- | src/upstart/ceph-mds-all-starter.conf | 2 | ||||
-rw-r--r-- | src/upstart/ceph-mon-all-starter.conf | 2 | ||||
-rw-r--r-- | src/upstart/ceph-osd-all-starter.conf | 2 | ||||
-rw-r--r-- | src/upstart/radosgw-all-starter.conf | 2 |
5 files changed, 5 insertions, 5 deletions
diff --git a/src/ceph_common.sh b/src/ceph_common.sh index 48354e41bfe..cedda4fb6c0 100644 --- a/src/ceph_common.sh +++ b/src/ceph_common.sh @@ -136,7 +136,7 @@ do_root_cmd() { get_local_daemon_list() { type=$1 if [ -d "/var/lib/ceph/$type" ]; then - for i in `find /var/lib/ceph/$type -mindepth 1 -maxdepth 1 -type d -printf '%f\n'`; do + for i in `find -L /var/lib/ceph/$type -mindepth 1 -maxdepth 1 -type d -printf '%f\n'`; do if [ -e "/var/lib/ceph/$type/$i/sysvinit" ]; then id=`echo $i | sed 's/[^-]*-//'` local="$local $type.$id" diff --git a/src/upstart/ceph-mds-all-starter.conf b/src/upstart/ceph-mds-all-starter.conf index e7fbf855ad4..fa18b25e87c 100644 --- a/src/upstart/ceph-mds-all-starter.conf +++ b/src/upstart/ceph-mds-all-starter.conf @@ -7,7 +7,7 @@ task script set -e # TODO what's the valid charset for cluster names and mds ids? - find /var/lib/ceph/mds/ -mindepth 1 -maxdepth 1 -regextype posix-egrep -regex '.*/[A-Za-z0-9]+-[A-Za-z0-9._-]+' -printf '%P\n' \ + find -L /var/lib/ceph/mds/ -mindepth 1 -maxdepth 1 -regextype posix-egrep -regex '.*/[A-Za-z0-9]+-[A-Za-z0-9._-]+' -printf '%P\n' \ | while read f; do if [ -e "/var/lib/ceph/mds/$f/done" ] && [ -e "/var/lib/ceph/mds/$f/upstart" ]; then cluster="${f%%-*}" diff --git a/src/upstart/ceph-mon-all-starter.conf b/src/upstart/ceph-mon-all-starter.conf index 9f5574f5baa..b9664b62fed 100644 --- a/src/upstart/ceph-mon-all-starter.conf +++ b/src/upstart/ceph-mon-all-starter.conf @@ -7,7 +7,7 @@ task script set -e # TODO what's the valid charset for cluster names and mon ids? - find /var/lib/ceph/mon/ -mindepth 1 -maxdepth 1 -regextype posix-egrep -regex '.*/[A-Za-z0-9]+-[A-Za-z0-9._-]+' -printf '%P\n' \ + find -L /var/lib/ceph/mon/ -mindepth 1 -maxdepth 1 -regextype posix-egrep -regex '.*/[A-Za-z0-9]+-[A-Za-z0-9._-]+' -printf '%P\n' \ | while read f; do if [ -e "/var/lib/ceph/mon/$f/done" ] && [ -e "/var/lib/ceph/mon/$f/upstart" ]; then cluster="${f%%-*}" diff --git a/src/upstart/ceph-osd-all-starter.conf b/src/upstart/ceph-osd-all-starter.conf index eeb64bca567..2e36dcceca6 100644 --- a/src/upstart/ceph-osd-all-starter.conf +++ b/src/upstart/ceph-osd-all-starter.conf @@ -11,7 +11,7 @@ script ceph-disk activate-all # TODO what's the valid charset for cluster names and osd ids? - find /var/lib/ceph/osd/ -mindepth 1 -maxdepth 1 -regextype posix-egrep -regex '.*/[A-Za-z0-9]+-[A-Za-z0-9._-]+' -printf '%P\n' \ + find -L /var/lib/ceph/osd/ -mindepth 1 -maxdepth 1 -regextype posix-egrep -regex '.*/[A-Za-z0-9]+-[A-Za-z0-9._-]+' -printf '%P\n' \ | while read f; do if [ -e "/var/lib/ceph/osd/$f/ready" ] && [ -e "/var/lib/ceph/osd/$f/upstart" ]; then cluster="${f%%-*}" diff --git a/src/upstart/radosgw-all-starter.conf b/src/upstart/radosgw-all-starter.conf index 15bbce28b23..8ab3c0d9029 100644 --- a/src/upstart/radosgw-all-starter.conf +++ b/src/upstart/radosgw-all-starter.conf @@ -7,7 +7,7 @@ task script set -e # TODO what's the valid charset for cluster names and daemon ids? - find /var/lib/ceph/radosgw/ -mindepth 1 -maxdepth 1 -regextype posix-egrep -regex '.*/[A-Za-z0-9]+-[A-Za-z0-9._-]+' -printf '%P\n' \ + find -L /var/lib/ceph/radosgw/ -mindepth 1 -maxdepth 1 -regextype posix-egrep -regex '.*/[A-Za-z0-9]+-[A-Za-z0-9._-]+' -printf '%P\n' \ | while read f; do if [ -e "/var/lib/ceph/radosgw/$f/done" ]; then cluster="${f%%-*}" |