diff --git a/roles/ceph-handler/templates/restart_osd_daemon.sh.j2 b/roles/ceph-handler/templates/restart_osd_daemon.sh.j2 index 6bddbf74d..7607f7f51 100644 --- a/roles/ceph-handler/templates/restart_osd_daemon.sh.j2 +++ b/roles/ceph-handler/templates/restart_osd_daemon.sh.j2 @@ -29,7 +29,7 @@ check_pgs() { wait_for_socket_in_container() { osd_mount_point=$({{ container_binary }} exec "$1" df --output=target | grep '/var/lib/ceph/osd/') whoami=$({{ container_binary }} exec "$1" cat $osd_mount_point/whoami) - if ! {{ container_binary }} exec "$1" timeout 10 bash -c "while [ ! -e /var/run/ceph/*.asok ]; do sleep 1 ; done"; then + if ! {{ container_binary }} exec "$1" timeout 10 bash -c "while [ ! -e /var/run/ceph/ceph-osd.${whoami}.asok ]; do sleep 1 ; done"; then echo "Timed out while trying to look for a Ceph OSD socket." echo "Abort mission!" exit 1 @@ -45,7 +45,7 @@ get_container_id_from_dev_name() { local count count=10 while [ $count -ne 0 ]; do - id=$({{ container_binary }} ps -q -f "name=$1") + id=$({{ container_binary }} ps -q -f "name=${1}$") test "$id" != "" && break sleep $DELAY let count=count-1 @@ -53,11 +53,6 @@ get_container_id_from_dev_name() { echo "$id" } -get_container_osd_id() { - wait_for_socket_in_container $1 - {{ container_binary }} exec "$1" ls /var/run/ceph | cut -d'.' -f2 -} - # For containerized deployments, the unit file looks like: ceph-osd@sda.service # For non-containerized deployments, the unit file looks like: ceph-osd@NNN.service where NNN is OSD ID for unit in $(systemctl list-units | grep -E "loaded * active" | grep -oE "ceph-osd@([0-9]+|[a-z]+).service"); do