From 651f5338929d6698190284c023979f126bff22f6 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 17 Oct 2018 13:23:46 +0200 Subject: [PATCH] Add new script to just stop it, not removing --- ceph-osd-stop-disable | 32 +++++++++++++++++++ ...remove => ceph-osd-stop-remove-permanently | 0 2 files changed, 32 insertions(+) create mode 100755 ceph-osd-stop-disable rename ceph-osd-stop-remove => ceph-osd-stop-remove-permanently (100%) diff --git a/ceph-osd-stop-disable b/ceph-osd-stop-disable new file mode 100755 index 0000000..990141e --- /dev/null +++ b/ceph-osd-stop-disable @@ -0,0 +1,32 @@ +#!/bin/sh +# 17:19, 2018-02-09 +# Nico Schottelius + +set -x +set -e + +if [ $# -ne 1 ]; then + echo "$0 osd.id" + echo "i.e. $0 17" + exit 1 +fi + +osd_id=$1; shift +osd_name=osd.${osd_id} +mountpath=/var/lib/ceph/osd/ceph-${osd_id} + +# Remove monit job +if [ -e /etc/monit ]; then + monit stop $osd_name + /opt/ungleich-tools/monit-remove $osd_name +else + /etc/init.d/ceph stop $osd_name +fi + +echo "Waiting for monit/ceph script to stop OSD" +sleep 2 + +umount "$mountpath" + +echo 'If you remove the disk, update the megacli configuration!' +echo 'i.e. discard cache probably (to be verified)' diff --git a/ceph-osd-stop-remove b/ceph-osd-stop-remove-permanently similarity index 100% rename from ceph-osd-stop-remove rename to ceph-osd-stop-remove-permanently