From 51081fa307340854bdd8ea47e3e24e85b496adfb Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 2 Mar 2010 15:41:23 -0800 Subject: [PATCH] init-ceph: return success error code on missing ceph.conf if no -c This will avoid errors when installing/removing the unconfigured package. --- src/ceph_common.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/ceph_common.sh b/src/ceph_common.sh index 32fc232fe4c86..4f6dcea9aa774 100644 --- a/src/ceph_common.sh +++ b/src/ceph_common.sh @@ -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 } -- 2.39.5