]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
init-ceph: return success error code on missing ceph.conf if no -c
authorSage Weil <sage@newdream.net>
Tue, 2 Mar 2010 23:41:23 +0000 (15:41 -0800)
committerSage Weil <sage@newdream.net>
Wed, 3 Mar 2010 22:40:31 +0000 (14:40 -0800)
This will avoid errors when installing/removing the unconfigured
package.

src/ceph_common.sh

index 32fc232fe4c86b09d02a83f013d41b0e33c16c29..4f6dcea9aa774de9f908c0babd5fdd6170d53d5a 100644 (file)
@@ -2,7 +2,9 @@
 
 CCONF="$BINDIR/cconf"
 
-conf=$ETCDIR"/ceph.conf"
+default_conf=$ETCDIR"/ceph.conf"
+conf=$default_conf
+
 hostname=`hostname | cut -d . -f 1`
 
 figure_dirs() {
@@ -19,8 +21,13 @@ figure_dirs() {
 
 verify_conf() {
     # make sure ceph.conf exists
+    
     if [ ! -e $conf ]; then
-       echo "$0: ceph conf $conf not found"
+       if [ "$conf" = "$default_conf" ]; then
+           echo "$0: ceph conf $conf not found; system is not configured."
+           exit 0
+       fi
+       echo "$0: ceph conf $conf not found!"
        usage_exit
     fi
 }