summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathan Cutler <ncutler@suse.com>2016-02-15 20:10:59 +0100
committerNathan Cutler <ncutler@suse.com>2016-02-18 12:19:14 +0100
commit69291f872e7dd20e88c052cfc220e02d59826c0f (patch)
tree667fbd17c2a4cac534eeb488509a222c0a8d1d7c
parentceph.spec.in: declare /usr/share/ceph properly (diff)
downloadceph-69291f872e7dd20e88c052cfc220e02d59826c0f.tar.xz
ceph-69291f872e7dd20e88c052cfc220e02d59826c0f.zip
packaging: move ceph_common.sh and ceph-osd-prestart.sh to /usr/lib/ceph
First, it makes sense for both ceph_common.sh and ceph-osd-prestart.sh to reside in the same directory: make it so. Second, /usr/lib exists on both RHEL/Fedora and SLE/openSUSE, whereas the later lacks /usr/libexec. To make this less painful, package ceph_common.sh and ceph-osd-prestart.sh in /usr/lib/ceph. Third, allow e.g. FreeBSD to do its own thing by using the $(libexecdir) Autoconf variable (but set it to /usr/lib in the spec file). http://tracker.ceph.com/issues/14687 Fixes: #14687 Signed-off-by: Nathan Cutler <ncutler@suse.com>
-rw-r--r--ceph.spec.in11
-rw-r--r--debian/ceph.install2
-rw-r--r--src/Makefile.am8
-rw-r--r--src/ceph-debugpack.in6
-rwxr-xr-xsrc/init-ceph.in8
-rw-r--r--src/upstart/ceph-osd.conf2
-rw-r--r--systemd/ceph-osd@.service2
7 files changed, 21 insertions, 18 deletions
diff --git a/ceph.spec.in b/ceph.spec.in
index 23fd55dfc59..51bba9d13f8 100644
--- a/ceph.spec.in
+++ b/ceph.spec.in
@@ -66,6 +66,10 @@ restorecon -R /var/log/ceph > /dev/null 2>&1;
%global _with_lttng 1
%endif
+# unify libexec for all targets
+%global _libexecdir %{_exec_prefix}/lib
+
+
#################################################################################
# common
#################################################################################
@@ -597,6 +601,7 @@ export RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS | sed -e 's/i386/i486/'`
%{configure} CPPFLAGS="$java_inc" \
--prefix=/usr \
+ --libexecdir=%{_libexecdir} \
--localstatedir=/var \
--sysconfdir=/etc \
%if 0%{?_with_systemd}
@@ -838,8 +843,8 @@ rm -rf $RPM_BUILD_ROOT
%else
/sbin/mount.ceph
%endif
-%dir %{_libdir}/ceph
-%{_libdir}/ceph/ceph_common.sh
+%dir %{_libexecdir}/ceph
+%{_libexecdir}/ceph/ceph_common.sh
%{_libexecdir}/ceph/ceph-osd-prestart.sh
%dir %{_libdir}/rados-classes
%{_libdir}/rados-classes/libcls_cephfs.so*
@@ -857,6 +862,7 @@ rm -rf $RPM_BUILD_ROOT
%{_libdir}/rados-classes/libcls_user.so*
%{_libdir}/rados-classes/libcls_version.so*
%{_libdir}/rados-classes/libcls_journal.so*
+%dir %{_libdir}/ceph
%dir %{_libdir}/ceph/erasure-code
%{_libdir}/ceph/erasure-code/libec_*.so*
%dir %{_libdir}/ceph/compressor
@@ -948,7 +954,6 @@ rm -rf $RPM_BUILD_ROOT
%{_datadir}/ceph/id_dsa_drop.ceph.com
%{_datadir}/ceph/id_dsa_drop.ceph.com.pub
%dir %{_sysconfdir}/ceph/
-%dir %{_libexecdir}/ceph/
%config %{_sysconfdir}/bash_completion.d/rados
%config %{_sysconfdir}/bash_completion.d/rbd
%config(noreplace) %{_sysconfdir}/ceph/rbdmap
diff --git a/debian/ceph.install b/debian/ceph.install
index c4889551171..98e2ae35fd8 100644
--- a/debian/ceph.install
+++ b/debian/ceph.install
@@ -21,9 +21,9 @@ usr/bin/osdmaptool
usr/lib/libos_tp.so.*
usr/lib/libosd_tp.so.*
usr/lib/ceph/ceph_common.sh
+usr/lib/ceph/ceph-osd-prestart.sh
usr/lib/ceph/erasure-code/*
usr/lib/rados-classes/*
-usr/libexec/ceph/ceph-osd-prestart.sh
usr/share/doc/ceph/sample.ceph.conf
usr/share/doc/ceph/sample.fetch_config
usr/share/man/man8/ceph-clsinfo.8
diff --git a/src/Makefile.am b/src/Makefile.am
index 92706c85085..85ebec7f677 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -62,6 +62,7 @@ editpaths = sed \
-e 's|@sysconfdir[@]|$(sysconfdir)|g' \
-e 's|@datadir[@]|$(pkgdatadir)|g' \
-e 's|@prefix[@]|$(prefix)|g' \
+ -e 's|@libexecdir[@]|$(libexecdir)|g' \
-e 's|@@GCOV_PREFIX_STRIP[@][@]|$(GCOV_PREFIX_STRIP)|g'
shell_scripts = ceph-debugpack ceph-post-file ceph-crush-location
$(shell_scripts): Makefile
@@ -128,13 +129,10 @@ docdir ?= ${datadir}/doc/ceph
doc_DATA = $(srcdir)/sample.ceph.conf sample.fetch_config
-# various scripts
-
-shell_commondir = $(libdir)/ceph
-shell_common_SCRIPTS = ceph_common.sh
+# various scripts in $(libexecdir)
ceph_libexecdir = $(libexecdir)/ceph
-ceph_libexec_SCRIPTS = ceph-osd-prestart.sh
+ceph_libexec_SCRIPTS = ceph_common.sh ceph-osd-prestart.sh
# tests to actually run on "make check"; if you need extra, non-test,
diff --git a/src/ceph-debugpack.in b/src/ceph-debugpack.in
index 9ac8f3bba79..fc6179646b3 100644
--- a/src/ceph-debugpack.in
+++ b/src/ceph-debugpack.in
@@ -4,11 +4,11 @@
# current directory too.
if [ `dirname $0` = "." ] && [ $PWD != "/etc/init.d" ]; then
BINDIR=.
- LIBDIR=.
+ LIBEXECDIR=.
ETCDIR=.
else
BINDIR=@bindir@
- LIBDIR=@libdir@/ceph
+ LIBEXECDIR=@libexecdir@/ceph
ETCDIR=@sysconfdir@/ceph
fi
@@ -32,7 +32,7 @@ wait_pid_exit() {
fi
}
-. $LIBDIR/ceph_common.sh
+. $LIBEXECDIR/ceph_common.sh
dest_tar=''
while [ $# -ge 1 ]; do
diff --git a/src/init-ceph.in b/src/init-ceph.in
index 91857f16328..5baa8fe7e83 100755
--- a/src/init-ceph.in
+++ b/src/init-ceph.in
@@ -26,14 +26,14 @@ grep -qs systemd /proc/1/comm || SYSTEMD_RUN=""
if [ `dirname $0` = "." ] && [ $PWD != "/etc/init.d" ]; then
BINDIR=.
SBINDIR=.
- LIBDIR=.
+ LIBEXECDIR=.
ETCDIR=.
SYSTEMD_RUN=""
ASSUME_DEV=1
else
BINDIR=@bindir@
SBINDIR=@prefix@/sbin
- LIBDIR=@libdir@/ceph
+ LIBEXECDIR=@libexecdir@/ceph
ETCDIR=@sysconfdir@/ceph
ASSUME_DEV=0
fi
@@ -65,9 +65,9 @@ usage_exit() {
# behave if we are not completely installed (e.g., Debian "removed,
# config remains" state)
-test -f $LIBDIR/ceph_common.sh || exit 0
+test -f $LIBEXECDIR/ceph_common.sh || exit 0
-. $LIBDIR/ceph_common.sh
+. $LIBEXECDIR/ceph_common.sh
EXIT_STATUS=0
diff --git a/src/upstart/ceph-osd.conf b/src/upstart/ceph-osd.conf
index dfba8d486a3..60b7b829c43 100644
--- a/src/upstart/ceph-osd.conf
+++ b/src/upstart/ceph-osd.conf
@@ -15,7 +15,7 @@ pre-start script
install -d -m0770 -o ceph -g ceph /var/run/ceph
- /usr/libexec/ceph/ceph-osd-prestart.sh --cluster="${cluster:-ceph}" -i "$id"
+ /usr/lib/ceph/ceph-osd-prestart.sh --cluster="${cluster:-ceph}" -i "$id"
end script
instance ${cluster:-ceph}/$id
diff --git a/systemd/ceph-osd@.service b/systemd/ceph-osd@.service
index 1e120c46f1b..0d73afbbbf2 100644
--- a/systemd/ceph-osd@.service
+++ b/systemd/ceph-osd@.service
@@ -10,7 +10,7 @@ LimitNPROC=1048576
EnvironmentFile=-/etc/sysconfig/ceph
Environment=CLUSTER=ceph
ExecStart=/usr/bin/ceph-osd -f --cluster ${CLUSTER} --id %i --setuser ceph --setgroup ceph
-ExecStartPre=/usr/libexec/ceph/ceph-osd-prestart.sh --cluster ${CLUSTER} --id %i --setuser ceph --setgroup ceph
+ExecStartPre=/usr/lib/ceph/ceph-osd-prestart.sh --cluster ${CLUSTER} --id %i --setuser ceph --setgroup ceph
ExecReload=/bin/kill -HUP $MAINPID
ProtectHome=true
ProtectSystem=full