From: Seena Fallah Date: Fri, 16 Feb 2024 13:58:10 +0000 (+0100) Subject: ceph-handler: restart existed rgw daemons X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=7142321bc3b69283d75d798956aa6597b74a5985;p=ceph-ansible.git 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 --- diff --git a/roles/ceph-handler/templates/restart_rgw_daemon.sh.j2 b/roles/ceph-handler/templates/restart_rgw_daemon.sh.j2 index 93eda64b8..416213782 100644 --- a/roles/ceph-handler/templates/restart_rgw_daemon.sh.j2 +++ b/roles/ceph-handler/templates/restart_rgw_daemon.sh.j2 @@ -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