5 echo INFO: starting $(basename "$0")
8 if ! pidof ceph-mon; then
9 echo INFO: ceph-mon is not running, skipping
14 INSTALLED_VERSION=$(ceph --version | awk '{print $3}')
15 if ! [[ "$INSTALLED_VERSION" =~ ^0\.94.* ]]; then
16 echo INFO: version of Ceph installed is not 0.94, skipping
20 MON_PID=$(pidof ceph-mon)
23 # Stop daemon using Hammer sysvinit script
24 service ceph stop mon.${MON_ID}
27 timeout 60 bash -c "while kill -0 ${MON_PID} 2> /dev/null; do
32 yum -y -q update ceph-mon
34 # Restart/Exit if not on Jewel, only in that case we need the changes
35 UPDATED_VERSION=$(ceph --version | awk '{print $3}')
36 if [[ "$UPDATED_VERSION" =~ ^0\.94.* ]]; then
37 echo WARNING: Ceph was not upgraded, restarting daemons
38 service ceph start mon.${MON_ID}
39 elif [[ "$UPDATED_VERSION" =~ ^10\.2.* ]]; then
40 echo INFO: Ceph was upgraded to Jewel
42 # RPM could own some of these but we can't take risks on the pre-existing files
43 for d in /var/lib/ceph/mon /var/log/ceph /var/run/ceph /etc/ceph; do
47 # Replay udev events with newer rules
51 systemctl enable ceph-mon.target
52 systemctl enable ceph-mon@${MON_ID}
53 systemctl start ceph-mon@${MON_ID}
55 # Wait for daemon to be back in the quorum
56 timeout 300 bash -c "until (ceph quorum_status | jq .quorum_names | grep -sq ${MON_ID}); do
57 echo Waiting for mon.${MON_ID} to re-join quorum;
61 echo ERROR: Ceph was upgraded to an unknown release, daemon is stopped, need manual intervention