]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
sysvinit, upstart: handle symlinks to dirs in /var/lib/ceph/*
authorSage Weil <sage@inktank.com>
Tue, 2 Jul 2013 21:43:17 +0000 (14:43 -0700)
committerSage Weil <sage@inktank.com>
Tue, 2 Jul 2013 21:43:17 +0000 (14:43 -0700)
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>
src/ceph_common.sh
src/upstart/ceph-mds-all-starter.conf
src/upstart/ceph-mon-all-starter.conf
src/upstart/ceph-osd-all-starter.conf
src/upstart/radosgw-all-starter.conf

index 48354e41bfe06c85b76d91100c6995786ff52001..cedda4fb6c03f9e1bec8dffe0689a0cd73e73cfa 100644 (file)
@@ -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"
index e7fbf855ad41eaba98c316f0a335587a6b0328a5..fa18b25e87c3b0c85f246dbdb893f21641b040db 100644 (file)
@@ -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%%-*}"
index 9f5574f5baa51bf82534f30d15b40686920a8127..b9664b62fedefa888f82c4cccce061a96f6c2a1e 100644 (file)
@@ -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%%-*}"
index eeb64bca567f73ad30f34ac4103bae942e587b3e..2e36dcceca63ba7d31d84f55c3e1a02e48c1b48a 100644 (file)
@@ -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%%-*}"
index 15bbce28b238e602e2093df38428600faafceb80..8ab3c0d90293b8e1f444731874bfdb0b9cf5079b 100644 (file)
@@ -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%%-*}"