]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
packaging: move ceph_common.sh and ceph-osd-prestart.sh to /usr/lib/ceph
authorNathan Cutler <ncutler@suse.com>
Mon, 15 Feb 2016 19:10:59 +0000 (20:10 +0100)
committerNathan Cutler <ncutler@suse.com>
Thu, 18 Feb 2016 11:19:14 +0000 (12:19 +0100)
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>
ceph.spec.in
debian/ceph.install
src/Makefile.am
src/ceph-debugpack.in
src/init-ceph.in
src/upstart/ceph-osd.conf
systemd/ceph-osd@.service

index 23fd55dfc59f92f67f64dd43708222df7d3c1a9c..51bba9d13f802a4063aede6c74b0c4035e9a49e0 100644 (file)
@@ -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
index c4889551171dcab7b5c1acc32bcb38c7082bb78b..98e2ae35fd8270651c33b9f4b25ecd398deff49a 100644 (file)
@@ -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
index 92706c850858e64fdeef89d54f8b68261060abce..85ebec7f677b57fc60312b2825a689382f6279d5 100644 (file)
@@ -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,
index 9ac8f3bba798b5634af45dc1829a6e65dd1a0500..fc6179646b39cf4c5232f74123558b0c9791a36b 100644 (file)
@@ -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
index 91857f16328ec68c5ad8f8e415ee49d1bf8bd4bf..5baa8fe7e83e786bcf5dc8ce03768bcaf3ccfbf5 100755 (executable)
@@ -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
 
index dfba8d486a392d214453efa74c8a0b2138913df5..60b7b829c43382e9e8f457a3deed41d14c9bdf59 100644 (file)
@@ -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
index 1e120c46f1ba62c1d368b7b7fde3db58956cd842..0d73afbbbf224f572f2061ec2ff439613615b2cd 100644 (file)
@@ -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