From ad3b788b0c83ffb1339d940cd86555dbc3b1b55f Mon Sep 17 00:00:00 2001 From: Nathan Cutler Date: Sat, 23 Apr 2016 20:33:17 +0200 Subject: [PATCH] Drop ceph Resource Agent This RA wraps the ceph sysvinit script. As of Jewel, none of the supported distros are using sysvinit anymore. So, drop it. Incidentally, Pacemaker can control systemd units without any wrappers. References: http://tracker.ceph.com/issues/14828 Signed-off-by: Nathan Cutler (cherry picked from commit bb624c7334ee4241ea3bf892f88e25d165dc3477) --- ceph.spec.in | 4 - configure.ac | 1 - src/ocf/Makefile.am | 14 +--- src/ocf/ceph.in | 177 -------------------------------------------- 4 files changed, 2 insertions(+), 194 deletions(-) delete mode 100644 src/ocf/ceph.in diff --git a/ceph.spec.in b/ceph.spec.in index 3cf6307f11773..cb7edccbc65c4 100644 --- a/ceph.spec.in +++ b/ceph.spec.in @@ -1201,10 +1201,6 @@ fi %dir %{_prefix}/lib/ocf %dir %{_prefix}/lib/ocf/resource.d %dir %{_prefix}/lib/ocf/resource.d/ceph -%exclude %{_prefix}/lib/ocf/resource.d/ceph/ceph -%exclude %{_prefix}/lib/ocf/resource.d/ceph/mds -%exclude %{_prefix}/lib/ocf/resource.d/ceph/mon -%exclude %{_prefix}/lib/ocf/resource.d/ceph/osd %{_prefix}/lib/ocf/resource.d/ceph/rbd %endif diff --git a/configure.ac b/configure.ac index e06baf155b4b2..2b2c602fa0bb0 100644 --- a/configure.ac +++ b/configure.ac @@ -1356,7 +1356,6 @@ AC_CONFIG_HEADERS([src/acconfig.h]) AC_CONFIG_FILES([Makefile src/Makefile src/ocf/Makefile - src/ocf/ceph src/ocf/rbd src/java/Makefile systemd/Makefile diff --git a/src/ocf/Makefile.am b/src/ocf/Makefile.am index 569f3abeb74ad..5ab8c2a5fb8dd 100644 --- a/src/ocf/Makefile.am +++ b/src/ocf/Makefile.am @@ -1,4 +1,4 @@ -EXTRA_DIST = ceph.in Makefile.in +EXTRA_DIST = Makefile.in if WITH_OCF # The root of the OCF resource agent hierarchy @@ -9,15 +9,5 @@ ocfdir = $(prefix)/lib/ocf # The ceph provider directory radir = $(ocfdir)/resource.d/$(PACKAGE_NAME) -ra_SCRIPTS = ceph rbd - -install-data-hook: - $(LN_S) ceph $(DESTDIR)$(radir)/osd - $(LN_S) ceph $(DESTDIR)$(radir)/mds - $(LN_S) ceph $(DESTDIR)$(radir)/mon - -uninstall-hook: - rm -f $(DESTDIR)$(radir)/osd - rm -f $(DESTDIR)$(radir)/mds - rm -f $(DESTDIR)$(radir)/mon +ra_SCRIPTS = rbd endif diff --git a/src/ocf/ceph.in b/src/ocf/ceph.in deleted file mode 100644 index 9448a2988f550..0000000000000 --- a/src/ocf/ceph.in +++ /dev/null @@ -1,177 +0,0 @@ -#!/bin/sh - -# Initialization: -: ${OCF_FUNCTIONS_DIR=${OCF_ROOT}/lib/heartbeat} -. ${OCF_FUNCTIONS_DIR}/ocf-shellfuncs - -# Convenience variables -# When sysconfdir isn't passed in as a configure flag, -# it's defined in terms of prefix -prefix=@prefix@ -CEPH_INIT=@sysconfdir@/init.d/ceph - -ceph_meta_data() { - local longdesc - local shortdesc - case $__SCRIPT_NAME in - "osd") - longdesc="Wraps the ceph init script to provide an OCF resource agent that manages and monitors the Ceph OSD service." - shortdesc="Manages a Ceph OSD instance." - ;; - "mds") - longdesc="Wraps the ceph init script to provide an OCF resource agent that manages and monitors the Ceph MDS service." - shortdesc="Manages a Ceph MDS instance." - ;; - "mon") - longdesc="Wraps the ceph init script to provide an OCF resource agent that manages and monitors the Ceph MON service." - shortdesc="Manages a Ceph MON instance." - ;; - esac - -cat < - - - 0.1 - ${longdesc} - ${shortdesc} - - - - - - - - - -EOF -} - -ceph_action() { - local init_action - init_action="$1" - - case ${__SCRIPT_NAME} in - osd|mds|mon) - ocf_run $CEPH_INIT $init_action ${__SCRIPT_NAME} - ;; - *) - ocf_run $CEPH_INIT $init_action - ;; - esac -} - -ceph_validate_all() { - # Do we have the ceph init script? - check_binary @sysconfdir@/init.d/ceph - - # Do we have a configuration file? - [ -e @sysconfdir@/ceph/ceph.conf ] || exit $OCF_ERR_INSTALLED -} - -ceph_monitor() { - local rc - - ceph_action status - - # 0: running, and fully caught up with master - # 3: gracefully stopped - # any other: error - case "$?" in - 0) - rc=$OCF_SUCCESS - ocf_log debug "Resource is running" - ;; - 3) - rc=$OCF_NOT_RUNNING - ocf_log debug "Resource is not running" - ;; - *) - ocf_log err "Resource has failed" - rc=$OCF_ERR_GENERIC - esac - - return $rc -} - -ceph_start() { - # if resource is already running, bail out early - if ceph_monitor; then - ocf_log info "Resource is already running" - return $OCF_SUCCESS - fi - - ceph_action start - - while ! ceph_monitor; do - ocf_log debug "Resource has not started yet, waiting" - sleep 1 - done - - return $OCF_SUCCESS -} - -ceph_stop() { - local rc - - # exit immediately if configuration is not valid - ceph_validate_all || exit $? - - ceph_monitor - rc=$? - case "$rc" in - "$OCF_SUCCESS") - # Currently running. Normal, expected behavior. - ocf_log debug "Resource is currently running" - ;; - "$OCF_NOT_RUNNING") - # Currently not running. Nothing to do. - ocf_log info "Resource is already stopped" - return $OCF_SUCCESS - ;; - esac - - ceph_action stop - - while ceph_monitor; do - ocf_log debug "Resource has not stopped yet, waiting" - sleep 1 - done - - # only return $OCF_SUCCESS if _everything_ succeeded as expected - return $OCF_SUCCESS - -} - - - -# Make sure meta-data and usage always succeed -case $__OCF_ACTION in -meta-data) ceph_meta_data - exit $OCF_SUCCESS - ;; -usage|help) ceph_usage - exit $OCF_SUCCESS - ;; -esac - -# Anything other than meta-data and usage must pass validation -ceph_validate_all || exit $? - -# Translate each action into the appropriate function call -case $__OCF_ACTION in -start) ceph_start;; -stop) ceph_stop;; -status|monitor) ceph_monitor;; -reload) ocf_log info "Reloading..." - ceph_start - ;; -validate-all) ;; -*) ceph_usage - exit $OCF_ERR_UNIMPLEMENTED - ;; -esac -rc=$? - -exit $rc -- 2.39.5