Skip to content

Commit

Permalink
packaging: move ceph_common.sh and ceph-osd-prestart.sh to /usr/lib/ceph
Browse files Browse the repository at this point in the history
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: ceph#14687

Signed-off-by: Nathan Cutler <[email protected]>
  • Loading branch information
smithfarm committed Feb 18, 2016
1 parent fe14a26 commit 69291f8
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 18 deletions.
11 changes: 8 additions & 3 deletions ceph.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
#################################################################################
Expand Down Expand Up @@ -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}
Expand Down Expand Up @@ -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*
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion debian/ceph.install
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 3 additions & 5 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions src/ceph-debugpack.in
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -32,7 +32,7 @@ wait_pid_exit() {
fi
}

. $LIBDIR/ceph_common.sh
. $LIBEXECDIR/ceph_common.sh

dest_tar=''
while [ $# -ge 1 ]; do
Expand Down
8 changes: 4 additions & 4 deletions src/init-ceph.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion src/upstart/ceph-osd.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion systemd/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 69291f8

Please sign in to comment.