Allow setting custom cluster names in init script

Also, remove unused patch file.

Resolves: rhbz#1269436
This commit is contained in:
Boris Ranto 2015-12-09 13:45:58 +01:00
parent 58a926ad22
commit d2c3e8a99e
3 changed files with 57 additions and 34 deletions

View File

@ -1,30 +0,0 @@
From e7b196a4a091c0ea258866559ba06e7ed0cc4247 Mon Sep 17 00:00:00 2001
From: Kefu Chai <kchai@redhat.com>
Date: Fri, 8 May 2015 15:21:20 +0800
Subject: [PATCH] mon: remove unused variable
* as a side effect, this change silences
http://tracker.ceph.com/issues/11576
Fixes: #11576
Signed-off-by: Kefu Chai <kchai@redhat.com>
---
src/mon/OSDMonitor.cc | 2 --
1 file changed, 2 deletions(-)
diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc
index 73dcd5f..7caaa45 100644
--- a/src/mon/OSDMonitor.cc
+++ b/src/mon/OSDMonitor.cc
@@ -3174,8 +3174,6 @@ bool OSDMonitor::preprocess_command(MMonCommand *m)
} else if (prefix == "osd crush get-tunable") {
string tunable;
cmd_getval(g_ceph_context, cmdmap, "tunable", tunable);
- int value;
- cmd_getval(g_ceph_context, cmdmap, "value", value);
ostringstream rss;
if (f)
f->open_object_section("tunable");
--
2.5.0

View File

@ -0,0 +1,48 @@
From 344856455c5452d573dd06eb26c52963dfa3105e Mon Sep 17 00:00:00 2001
From: Anthony Alba <ascanio.alba7@gmail.com>
Date: Mon, 30 Nov 2015 16:44:31 +0800
Subject: [PATCH] init-ceph.in: Allow custom cluster names during startup.
Signed-off-by: Richard Chan <richard@treeboxsolutions.com>
---
src/init-ceph.in | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/src/init-ceph.in b/src/init-ceph.in
index 2ff98c7..245068a 100644
--- a/src/init-ceph.in
+++ b/src/init-ceph.in
@@ -117,6 +117,10 @@ dofsumount=0
verbose=0
use_default_conf=1
+## set variables like cluster or conf
+[ -e /etc/sysconfig/ceph ] && . /etc/sysconfig/ceph
+[ -e /etc/default/ceph ] && . /etc/default/ceph
+
while echo $1 | grep -q '^-'; do # FIXME: why not '^-'?
case $1 in
@@ -282,7 +286,7 @@ for name in $what; do
lockfile=""
fi
- get_conf asok "$run_dir/ceph-$type.$id.asok" "admin socket"
+ get_conf asok "$run_dir/$cluster-$type.$id.asok" "admin socket"
case "$command" in
start)
@@ -395,8 +399,8 @@ for name in $what; do
# these keys. it's also true for legacy installs
# via mkcephfs, which is fine too; there is no harm
# in creating these keys.
- get_conf mon_data "/var/lib/ceph/mon/ceph-$id" "mon data"
- if [ "$mon_data" = "/var/lib/ceph/mon/ceph-$id" -a "$asok" = "/var/run/ceph/ceph-mon.$id.asok" ]; then
+ get_conf mon_data "/var/lib/ceph/mon/$cluster-$id" "mon data"
+ if [ "$mon_data" = "/var/lib/ceph/mon/$cluster-$id" -a "$asok" = "/var/run/ceph/$cluster-mon.$id.asok" ]; then
echo Starting ceph-create-keys on $host...
cmd2="$SBINDIR/ceph-create-keys --cluster $cluster -i $id 2> /dev/null &"
do_cmd "$cmd2"
--
2.1.0

View File

@ -12,7 +12,7 @@
#################################################################################
Name: ceph
Version: 0.94.5
Release: 1%{?dist}
Release: 2%{?dist}
Epoch: 1
Summary: User space components of the Ceph file system
License: GPLv2
@ -20,12 +20,13 @@ Group: System Environment/Base
URL: http://ceph.com/
Source0: http://ceph.com/download/%{name}-%{version}.tar.bz2
%if 0%{?fedora} || 0%{?centos} || 0%{?rhel}
Patch0: init-ceph.in-fedora.patch
Patch0000: init-ceph.in-fedora.patch
%endif
Patch1: 0001-Disable-erasure_codelib-neon-build.patch
Patch0001: 0001-Disable-erasure_codelib-neon-build.patch
Patch0002: 0002-init-ceph.in-Allow-custom-cluster-names-during-start.patch
# fix build without tcmalloc
# https://github.com/ceph/rocksdb/pull/5
Patch10: ceph-0.94.1-tcmalloc.patch
Patch0010: ceph-0.94.1-tcmalloc.patch
Requires: librbd1 = %{epoch}:%{version}-%{release}
Requires: librados2 = %{epoch}:%{version}-%{release}
Requires: libcephfs1 = %{epoch}:%{version}-%{release}
@ -429,6 +430,7 @@ python-cephfs instead.
%patch0 -p1 -b .init
%endif
%patch1 -p1
%patch2 -p1
%patch10 -p1 -b .tcmalloc
%build
@ -933,6 +935,9 @@ ln -sf %{_libdir}/librbd.so.1 /usr/lib64/qemu/librbd.so.1
# actually build this meta package.
%changelog
* Wed Dec 09 2015 Boris Ranto <branto@redhat.com> - 1:0.94.5-2
- Allow setting custom cluster names in init script (#1269436)
* Tue Oct 27 2015 Boris Ranto <branto@redhat.com> - 1:0.94.5-1
- Rebase to latest upstream version