ceph-handler: restart existed rgw daemons

This is needed for new instances are the restart might trigger before the deployment

Signed-off-by: Seena Fallah <seenafallah@gmail.com>
pull/7482/head
Seena Fallah 2024-02-16 14:58:10 +01:00 committed by Guillaume Abrioux
parent daaba8098c
commit 7142321bc3
1 changed files with 10 additions and 1 deletions

View File

@ -74,7 +74,16 @@ check_rest() {
for ((i=0; i<${RGW_NUMS}; i++)); do
# First, restart the daemon
systemctl restart ceph-radosgw@rgw.${HOST_NAME}.${INSTANCES_NAME[i]}
# Check if systemd unit exists
# This is needed for new instances are the restart might trigger before the deployment
if systemctl list-units --full --all | grep -q "ceph-radosgw@rgw.${HOST_NAME}.${INSTANCES_NAME[i]}"; then
systemctl restart ceph-radosgw@rgw.${HOST_NAME}.${INSTANCES_NAME[i]}
else
echo "Systemd unit ceph-radosgw@rgw.${HOST_NAME}.${INSTANCES_NAME[i]} does not exist."
continue
fi
# Check socket files
check_socket ${i}
# Check rest