]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mkcephfs, init-ceph: Warn if hostname "localhost" is seen in ceph.conf.
authorTommi Virtanen <tv@inktank.com>
Tue, 21 Aug 2012 00:06:09 +0000 (17:06 -0700)
committerTommi Virtanen <tv@inktank.com>
Tue, 21 Aug 2012 00:16:41 +0000 (17:16 -0700)
Given a ceph.conf that looks like

  [osd.42]
  host = localhost

mkcephfs used to exit with an obscure error message:

  cat: /tmp/mkcephfs.MCBIHvn4Ru/key.*: No such file or directory

"localhost" was never intended to be a valid hostname to use there.
Warn if we see it, and skip the entry. You should use the proper short
hostname of the box.

As init-ceph and mkcephfs share this library, this change affects the
sysvinit scripts too. The behavior *shouldn't* change there (localhost
entries were ignored earlier, too), but you may see this extra
warning. Which is good.

Closes: #3001
Signed-off-by: Tommi Virtanen <tv@inktank.com>
src/ceph_common.sh

index 62c28ffffd42d22c9440d8c4275462a17ab62d61..73f13f4585b4f871146dc4e6a5b2578aeeef0365 100644 (file)
@@ -34,7 +34,10 @@ verify_conf() {
 check_host() {
     # what host is this daemon assigned to?
     host=`$CCONF -c $conf -n $type.$id host`
-    [ "$host" = "localhost" ] && host=""
+    if [ "$host" = "localhost" ]; then
+       echo "$0: use a proper short hostname, not 'localhost', in $conf section $type.$id; skipping entry"
+       return 1
+    fi
     ssh=""
     rootssh=""
     sshdir=$PWD