From 6bcb2b6734b9ca3842791c082a7106d0b34373bc Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sun, 7 Feb 2021 13:01:48 +0100 Subject: [PATCH] [monit/ceph] always use monit -> same for all OS --- ceph/ceph-mgr-create-start | 12 ++++------ ceph/ceph-mon-create-start | 8 ++----- ceph/ceph-osd-create-start | 8 ++----- monit-ceph-create-start | 45 +++++++++++++++----------------------- 4 files changed, 26 insertions(+), 47 deletions(-) diff --git a/ceph/ceph-mgr-create-start b/ceph/ceph-mgr-create-start index e9a8842..e47cf4b 100755 --- a/ceph/ceph-mgr-create-start +++ b/ceph/ceph-mgr-create-start @@ -3,7 +3,7 @@ name=$(hostname) CEPH_PATH=/var/lib/ceph -MGR_PATH=$CEPH_PATH/mgr/ceph-$name +MGR_PATH=$CEPH_PATH/mgr/ceph-${name} if [ -e "$MGR_PATH" ]; then echo "$MGR_PATH exists - aborting" @@ -14,14 +14,10 @@ mkdir "$MGR_PATH" chown ceph:ceph "$MGR_PATH" touch "$MGR_PATH/sysvinit" -ceph auth get-or-create mgr.$name \ +ceph auth get-or-create mgr.${name} \ mon 'allow profile mgr' \ osd 'allow *' \ mds 'allow *' > "$MGR_PATH/keyring" -# Starting with monit, if available -if [ -e /etc/monit ]; then - /opt/ungleich-tools/monit-ceph-create-start mgr.${name} -else - /etc/init.d/ceph start mgr.${name} -fi +# Starting with monit - same on every os +/opt/ungleich-tools/monit-ceph-create-start mgr.${name} diff --git a/ceph/ceph-mon-create-start b/ceph/ceph-mon-create-start index 1a801a8..239e221 100755 --- a/ceph/ceph-mon-create-start +++ b/ceph/ceph-mon-create-start @@ -13,9 +13,5 @@ chown -R ceph:ceph /var/lib/ceph/mon/ceph-$(hostname) # Fix broken permissions on Debian chown ceph:ceph /var/run/ceph/ -# Starting with monit, if available -if [ -e /etc/monit ]; then - /opt/ungleich-tools/monit-ceph-create-start mon.$(hostname) -else - /etc/init.d/ceph start mon.$(hostname) -fi +# Starting with monit +/opt/ungleich-tools/monit-ceph-create-start mon.$(hostname) diff --git a/ceph/ceph-osd-create-start b/ceph/ceph-osd-create-start index 106e363..e1b350e 100755 --- a/ceph/ceph-osd-create-start +++ b/ceph/ceph-osd-create-start @@ -100,9 +100,5 @@ ceph osd crush set-device-class $CLASS osd.${osd_id} echo "$metadata_dev /var/lib/ceph/osd/ceph-${osd_id} xfs noatime 0 0" >> /etc/fstab -# Starting with monit, if available -if [ -e /etc/monit ]; then - /opt/ungleich-tools/monit-ceph-create-start osd.${osd_id} -else - /etc/init.d/ceph start osd.${osd_id} -fi +# Start it +/opt/ungleich-tools/monit-ceph-create-start osd.${osd_id} diff --git a/monit-ceph-create-start b/monit-ceph-create-start index a44efa0..2c69b4c 100755 --- a/monit-ceph-create-start +++ b/monit-ceph-create-start @@ -13,44 +13,35 @@ to_monitor=$1 set -e depends="cephrundir" -osd="" conf="/etc/monit/conf.d/$to_monitor" -if echo $to_monitor | grep ^osd; then - depends="${depends}, ${to_monitor}-whoami" - osd="yes" - osdid=$(echo $to_monitor | cut -d. -f2) - cat > "$conf" <> "$conf" < "$conf" <> "$conf" <> "$conf" <