]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
init-radosgw: look in /var/lib/ceph/radosgw
authorSage Weil <sage@redhat.com>
Thu, 7 May 2015 22:29:11 +0000 (15:29 -0700)
committerKen Dreyer <kdreyer@redhat.com>
Wed, 20 May 2015 01:10:53 +0000 (19:10 -0600)
Signed-off-by: Sage Weil <sage@redhat.com>
(cherry picked from commit a4bb992426b39188e750fce9198052ca0d510117)

src/init-radosgw

index 914d6fddcc1a47a165e6d321a6b5314f74c85215..c191a88b187d62d7c11ebe271939da6897985660 100644 (file)
@@ -43,22 +43,37 @@ if [ ! -x "$RADOSGW" ]; then
     exit 1
 fi
 
+# list daemons, old-style and new-style
+# NOTE: no support for cluster names that aren't "ceph"
+dlist=`ceph-conf --list-sections $PREFIX`
+if [ -d "/var/lib/ceph/radosgw" ]; then
+    for d in `ls /var/lib/ceph/radosgw | grep ^ceph-`; do
+       if [ -e "/var/lib/ceph/radosgw/$d/sysvinit" ]; then
+           id=`echo $d | cut -c 6-`
+           dlist="client.$id $dlist"
+       fi
+    done
+fi
+
 case "$1" in
     start)
-        for name in `ceph-conf --list-sections $PREFIX`;
+        for name in $dlist
         do
             auto_start=`ceph-conf -n $name 'auto start'`
             if [ "$auto_start" = "no" ] || [ "$auto_start" = "false" ] || [ "$auto_start" = "0" ]; then
                 continue
             fi
 
-            # mapped to this host?
-            host=`ceph-conf -n $name host`
-            hostname=`hostname -s`
-            if [ "$host" != "$hostname" ]; then
-                [ $VERBOSE -eq 1 ] && echo "hostname $hostname could not be found in ceph.conf:[$name], not starting."
-                continue
-            fi
+           shortname=`echo $name | cut -c 8-`
+           if [ ! -e "/var/lib/ceph/radosgw/ceph-$shortname/sysvinit" ]; then
+                # mapped to this host?
+               host=`ceph-conf -n $name host`
+               hostname=`hostname -s`
+               if [ "$host" != "$hostname" ]; then
+                    [ $VERBOSE -eq 1 ] && echo "hostname $hostname could not be found in ceph.conf:[$name], not starting."
+                    continue
+               fi
+           fi
 
             user=`ceph-conf -n $name user`
             if [ -z "$user" ]; then