Skip to content

Commit

Permalink
ceph-handler: restart existed rgw daemons
Browse files Browse the repository at this point in the history
This is needed for new instances are the restart might trigger before the deployment

Signed-off-by: Seena Fallah <[email protected]>
(cherry picked from commit 7142321)
  • Loading branch information
clwluvw authored and guits committed Mar 10, 2024
1 parent f34484f commit bed3f86
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion roles/ceph-handler/templates/restart_rgw_daemon.sh.j2
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit bed3f86

Please sign in to comment.