}
# For containerized deployments, the unit file looks like: ceph-osd@sda.service
-# For non-containerized deployments, the unit file looks like: ceph-osd@0.service
-for unit in $(systemctl list-units | grep -E "loaded * active" | grep -oE "ceph-osd@([0-9]{1,2}|[a-z]+).service"); do
+# 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]{1,}|[a-z]+).service"); do
# First, restart daemon(s)
systemctl restart "${unit}"
# We need to wait because it may take some time for the socket to actually exists
osd_id=$(get_docker_osd_id "$container_id")
docker_exec="docker exec $container_id"
{% else %}
- osd_id=$(echo ${unit#ceph-osd@} | grep -oE '[0-9]{1,2}')
+ osd_id=$(echo ${unit#ceph-osd@} | grep -oE '[0-9]{1,}')
{% endif %}
SOCKET=/var/run/ceph/{{ cluster }}-osd.${osd_id}.asok
while [ $COUNT -ne 0 ]; do