From 6a9bcc09a36e25f4e48994e9760b0d39f74b1bde Mon Sep 17 00:00:00 2001 From: Tommi Virtanen Date: Mon, 20 Aug 2012 17:06:09 -0700 Subject: [PATCH] mkcephfs, init-ceph: Warn if hostname "localhost" is seen in ceph.conf. 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 --- src/ceph_common.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ceph_common.sh b/src/ceph_common.sh index 62c28ffffd42d..73f13f4585b4f 100644 --- a/src/ceph_common.sh +++ b/src/ceph_common.sh @@ -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 -- 2.39.5