Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 19 additions & 5 deletions azure-slurm-install/start-services.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,27 @@ run_slurmdbd_via_systemctl() {
echo "Starting slurmdbd via systemctl..."
systemctl start slurmdbd

# Verify slurmdbd is responding
sleep 10
if ! sacctmgr ping > /dev/null 2>&1; then
echo "ERROR: slurmdbd started but is not responding to sacctmgr ping"
# Verify slurmdbd is responding with retry logic
attempts=3
delay=5
ping_rc=0
set +e
for i in $( seq 1 $attempts ); do
echo $i/$attempts sleeping $delay seconds before running sacctmgr ping
sleep $delay
sacctmgr ping > /dev/null 2>&1
ping_rc=$?
if [ "$ping_rc" -eq 0 ]; then
echo "slurmdbd is running and responding to ping"
set -e
return 0
fi
done

if [ "$i" == "$attempts" ] && [ "$ping_rc" -ne 0 ]; then
echo "ERROR: slurmdbd started but is not responding to sacctmgr ping after $attempts attempts"
exit 2
Comment on lines +27 to 29
fi
echo "slurmdbd is running and responding to ping"
}

run_slurmdbd() {
Expand Down
Loading