#!/bin/bash RETRIES="{{ handler_health_mds_check_retries }}" DELAY="{{ handler_health_mds_check_delay }}" MDS_NAME="{{ mds_name }}" SOCKET=/var/run/ceph/{{ cluster }}-mds.${MDS_NAME}.asok {% if containerized_deployment %} DOCKER_EXEC="docker exec ceph-mds-{{ ansible_hostname }}" {% endif %} # First, restart the daemon systemctl restart ceph-mds@${MDS_NAME} COUNT=10 # Wait and ensure the socket exists after restarting the daemds while [ $RETRIES -ne 0 ]; do $DOCKER_EXEC test -S $SOCKET && exit 0 sleep $DELAY let RETRIES=RETRIES-1 done # If we reach this point, it means the socket is not present. echo "Socket file ${SOCKET} could not be found, which means the Metadata Server is not running." exit 1